domain-hound 0.1.4 → 0.1.5

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.
@@ -4,6 +4,7 @@ import { shopSearchUrl } from './prices.mjs';
4
4
  import { checkHandles, compactText, handleSearches, letters, searchApps, searchEntities, searchMarks, trademarkSearches } from './triage-sources.mjs';
5
5
  import { loadEdgarCompanies, matchEdgarCompanies, searchNorwegianCompanies } from './company-search.mjs';
6
6
  import { mapLimit } from './cache.mjs';
7
+ import { checkSocialHandles } from './handles.mjs';
7
8
  import { checkDomainSite } from './com-site.mjs';
8
9
  import { playSearchLink, searchAndroidApps } from './google-play.mjs';
9
10
  import { googleSearchLink, lowerVerdict, nameCheckLines, searchGoogle } from './google-search.mjs';
@@ -11,6 +12,11 @@ import { autocompleteWords, collectRivals, createTraction, evidenceLifetime, jud
11
12
  tractionNotes, tractionSummary, tractionVerdict } from './traction.mjs';
12
13
 
13
14
  const coreWebsiteEndings = ['com', 'ai', 'io', 'app', 'co'];
15
+ // The slow, rate-limited sources (trademarks, app stores, rivals, web traction, GitHub and npm) screen only the first
16
+ // five names; registry answers and prices cover every name. Social handle rows go to the top three.
17
+ export const screenLimit = 5;
18
+ export const handleLimit = 3;
19
+ export const notScreened = 'Not screened (marks, apps, rivals: first ' + screenLimit + ' names only)';
14
20
  const typicalProducts = [
15
21
  [/(?:domain|whois)/, /\b(?:domains?|whois|registrar)\b/i],
16
22
  [/(?:accounting|bookkeep|invoice|ledger)/, /\b(?:accounting|bookkeeping|invoic(?:e|ing)|ledger)\b/i],
@@ -90,7 +96,7 @@ function counted(count, singular, plural = singular + 's') {
90
96
  return count + ' ' + (count === 1 ? singular : plural);
91
97
  }
92
98
 
93
- function sameNameEvidence({ name, live, norway, us, entities, entity, github, handles }) {
99
+ function sameNameEvidence({ name, live, norway, us, entities, entity, github, handles, deferHandles }) {
94
100
  const sameBusiness = live.filter(site => site.sameBusiness).length;
95
101
  const businesses = new Map();
96
102
  for (const { business } of live) if (business !== 'unknown') businesses.set(business, (businesses.get(business) ?? 0) + 1);
@@ -106,14 +112,13 @@ function sameNameEvidence({ name, live, norway, us, entities, entity, github, ha
106
112
  github.ownerType === 'Organization' && 'GitHub org taken',
107
113
  repos && counted(repos, 'GitHub repo'),
108
114
  handles.npm === 'taken' && 'npm package',
109
- handles.PyPI === 'taken' && 'PyPI package',
110
115
  ].filter(Boolean);
111
116
  const count = live.length + (norway?.matches.length ?? 0) + (us?.matches.length ?? 0) + (entities?.length ?? 0)
112
117
  + Math.min(repos * 0.25, 1) + Number(github.ownerType === 'Organization')
113
- + Number(handles.npm === 'taken') + Number(handles.PyPI === 'taken');
118
+ + Number(handles.npm === 'taken');
114
119
  const unchecked = [
115
- !norway && 'Brønnøysund', !us && 'EDGAR', !entities && 'Wikidata', github.status === 'unknown' && 'GitHub',
116
- handles.npm === 'unknown' && 'npm', handles.PyPI === 'unknown' && 'PyPI',
120
+ !norway && 'Brønnøysund', !us && 'EDGAR', !entities && 'Wikidata', !deferHandles && github.status === 'check' && 'GitHub',
121
+ !deferHandles && handles.npm === 'check' && 'npm',
117
122
  ].filter(Boolean);
118
123
  return {
119
124
  summary: 'Same name used by: ' + (summary.join(', ') || 'none found'),
@@ -151,8 +156,8 @@ function verdict({ mark, otherMark, silent, ...evidence }) {
151
156
  function silentSources({ marks, apps, android, entities, norway, edgar, github, handles }) {
152
157
  return Object.entries({
153
158
  USPTO: marks, 'App Store': apps, 'Google Play': android, Wikidata: entities, Brønnøysund: norway,
154
- EDGAR: edgar, GitHub: github.status === 'unknown' ? null : github.status,
155
- npm: handles.npm === 'unknown' ? null : handles.npm, PyPI: handles.PyPI === 'unknown' ? null : handles.PyPI,
159
+ EDGAR: edgar, GitHub: github.status === 'check' ? null : github.status,
160
+ npm: handles.npm === 'check' ? null : handles.npm,
156
161
  }).filter(([, value]) => value == null).map(([source]) => source);
157
162
  }
158
163
 
@@ -262,7 +267,7 @@ export async function triageNames(inputs, options = {}) {
262
267
  const started = performance.now();
263
268
  const timeLeft = () => budgetMs - (performance.now() - started);
264
269
  const signal = AbortSignal.timeout(budgetMs);
265
- const sources = { ...options, signal, timeLeft, cacheLifetime: evidenceLifetime, retryUnavailable: true, githubSearch: names.size <= 5 };
270
+ const sources = { ...options, signal, timeLeft, cacheLifetime: evidenceLifetime, retryUnavailable: true, githubSearch: true };
266
271
  // Ask an unavailable source once more while the triage budget lasts.
267
272
  const retry = async (lookup, answered) => {
268
273
  const first = await lookup();
@@ -277,7 +282,7 @@ export async function triageNames(inputs, options = {}) {
277
282
  };
278
283
  const onSite = (domain, site) => {
279
284
  const name = domain.slice(0, domain.indexOf('.'));
280
- if (!nameOf.has(name)) return;
285
+ if (!nameOf.has(name) || nameOf.get(name) >= screenLimit) return;
281
286
  if (site?.state === 'live') startHomes(name, [domain]);
282
287
  else if (site?.state === 'parked' || site?.state === 'for-sale') startHomes(name, [domain], false);
283
288
  };
@@ -285,8 +290,12 @@ export async function triageNames(inputs, options = {}) {
285
290
  name, candidates: nameCandidates(name, { variants: false, endings: websiteEndings }),
286
291
  }));
287
292
  const entries = [...names].map(([name, input], index) => [keys.get(name), input, index]);
293
+ // The names put first are screened in full: the person's own name and the strongest candidates.
294
+ const screened = entries.slice(0, screenLimit);
295
+ const isScreened = index => index < screenLimit;
296
+ const screenedDomains = new Set([...names.keys()].slice(0, screenLimit));
288
297
  const check = (concurrency, lookup, after = () => {}) => mapLimit(entries, concurrency, async ([name, input, index]) => {
289
- const result = signal.aborted ? null : await retry(() => lookup(name, input, sources), found);
298
+ const result = signal.aborted || !isScreened(index) ? null : await retry(() => lookup(name, input, sources), found);
290
299
  after(result, index);
291
300
  return result;
292
301
  });
@@ -302,24 +311,37 @@ export async function triageNames(inputs, options = {}) {
302
311
  startHomes(name, (result ?? []).filter(row => row.brand).flatMap(row => (row.website ?? []).map(siteDomain))
303
312
  .filter(domain => domain?.split('.')[0].includes(name)));
304
313
  });
305
- const [domains, marksByName, appsByName, entitiesByName, handlesByName, norwayByName, androidApps, edgar, googleByName] =
314
+ const domainsDone = searchCandidates(groups, { ...options, budgetMs: Math.min(budgetMs, 11500),
315
+ siteEndings: websiteEndings, siteTimeout: 3000, siteDetails: true, onSite,
316
+ siteFilter: domain => screenedDomains.has(domain.slice(0, domain.indexOf('.'))) });
317
+ // GitHub and npm accounts are same-name evidence for every screened name; they share one run of controls.
318
+ const evidenceHandles = options.deferHandles ? Promise.resolve(new Map()) : checkSocialHandles(screened.map(([name]) => ({ name, platforms: ['GitHub', 'npm'], links: false })),
319
+ { ...options, signal });
320
+ // Once the registry answers are in, the top three names get the full handle row, with Bluesky and variants.
321
+ const handleRows = options.deferHandles || options.handleRows === false ? Promise.resolve(new Map()) : domainsDone.then(domains => {
322
+ const order = handleOrder(domains.groups, keys, options.eligible).slice(0, handleLimit);
323
+ options.onProgress?.({ stage: 'handles' });
324
+ return evidenceHandles.then(() => checkSocialHandles(order.map(key => ({ name: key, variants: true })), { ...options, signal }));
325
+ }).catch(() => new Map());
326
+ const [domains, marksByName, appsByName, entitiesByName, handlesByName, norwayByName, androidApps, edgar, googleByName, socialByName] =
306
327
  await Promise.all([
307
328
  // A cold cache still gets the bundled, dated list prices, so free endings never all read "price at shop".
308
- searchCandidates(groups, { ...options, budgetMs: Math.min(budgetMs, 11500),
309
- siteEndings: websiteEndings, siteTimeout: 3000, siteDetails: true, onSite }),
329
+ domainsDone,
310
330
  check(6, searchMarks), check(8, searchApps, (result, index) => startHomes(entries[index][0],
311
331
  (result ?? []).map(row => siteDomain(row.sellerUrl)).filter(domain => domain?.split('.')[0].includes(entries[index][0])))),
312
332
  entityChecks,
313
- Promise.all(entries.map(([name]) => checkHandles(name, sources))),
333
+ Promise.all(entries.map(([name], index) => isScreened(index)
334
+ ? checkHandles(name, { ...sources, social: evidenceHandles.then(rows => rows.get(name)).catch(() => null) }) : null)),
314
335
  check(8, searchNorwegianCompanies),
315
- searchAndroidApps(new Map(entries.map(([key, input]) => [key, input])),
336
+ searchAndroidApps(new Map(screened.map(([key, input]) => [key, input])),
316
337
  { ...sources, playBudgetMs: Math.min(12000, options.playBudgetMs ?? Infinity, budgetMs) }),
317
338
  retry(() => loadEdgarCompanies(sources), found),
318
- mapLimit(entries, 5, ([name, input, index]) => searchGoogle(name, input, {
339
+ mapLimit(entries, 5, ([name, input, index]) => isScreened(index) ? searchGoogle(name, input, {
319
340
  ...sources, timeoutMs: timeLeft(),
320
341
  entities: entities[index].promise,
321
342
  sameBusiness: text => describedBusiness(name, text, options.about, options.category),
322
- })),
343
+ }) : { unchecked: 'not screened' }),
344
+ handleRows,
323
345
  ]);
324
346
  const counts = {};
325
347
  function coverage(source, answered) { counts[source] = (counts[source] ?? 0) + Number(answered); }
@@ -329,6 +351,7 @@ export async function triageNames(inputs, options = {}) {
329
351
  ...(androidApps.get(keys.get(name)) ?? []).map(row => ({ ...row, store: 'Android', ref: row })),
330
352
  ]);
331
353
  const rivalsByName = domains.groups.map(({ name, sites }, index) => {
354
+ if (!isScreened(index)) return [];
332
355
  const raw = googleByName[index].raw ?? {};
333
356
  const key = keys.get(name);
334
357
  const rivals = collectRivals({
@@ -342,6 +365,40 @@ export async function triageNames(inputs, options = {}) {
342
365
  options.onProgress?.({ stage: 'rivals' });
343
366
  const evidence = await traction.settle();
344
367
  const rows = domains.groups.map(({ name, results, sites }, index) => {
368
+ const requested = results.filter(row => endings.includes(row.tld));
369
+ const available = results.filter(row => row.status === 'probably-free' && endings.includes(row.tld));
370
+ const recommendable = available.filter(row => canRecommend(row.tld, options.eligible));
371
+ const [best] = recommendable;
372
+ const social = socialByName.get(keys.get(name)) ?? null;
373
+ const domainFields = {
374
+ taken: requested.filter(row => row.status === 'taken').map(row => row.tld),
375
+ shop_check: requested.filter(row => ['check-at-shop', 'reserved'].includes(row.status)).map(row => row.tld),
376
+ ...(requested.some(row => row.status === 'reserved') && {
377
+ reserved: requested.filter(row => row.status === 'reserved').map(row => row.tld) }),
378
+ // Subsets of shop_check with a DNS likelihood; only a registry or shop settles them.
379
+ ...likelyEndings(requested),
380
+ // Premium endings never carry a list price; the shop shows their price. A short name may be premium.
381
+ ...(requested.some(row => row.status === 'premium') && {
382
+ premium: requested.filter(row => row.status === 'premium').map(row => row.tld) }),
383
+ };
384
+ const receipt = options.receipt && { _receiptEndings: requested.map(row => ({ domain: row.domain, source: row.source,
385
+ checkedAt: row.checkedAt, priceAt: row.priceCheckedAt, shop: row.shop, checkout: row.buyUrl,
386
+ site: sites[row.tld], risk: row.premium === 'risk' || row.premiumRisk })), _handles: social };
387
+ if (!isScreened(index)) {
388
+ // Registry answers and prices only. The verdict never reads "No conflict found" without the checks.
389
+ return {
390
+ name: names.get(name), verdict: 'Check first', reason: notScreened,
391
+ _free: available, _recommendable: recommendable, _googleExplained: true,
392
+ google: { result: 'not checked', why: 'not screened', link: googleSearchLink(names.get(name)) },
393
+ ...domainFields,
394
+ competition: { US: null, mark: null, AppStore: null, GooglePlay: null, Wikidata: null,
395
+ sameName: { summary: 'Not screened', level: 'unknown' } },
396
+ buy: best ? best.buyUrl ?? shopSearchUrl(best.confirmShop, best.domain) : null,
397
+ ...receipt,
398
+ details: { memorable: memorability(keys.get(name), names.get(name)), presence: null, sites: {},
399
+ appName: 'App name: not checked', AndroidSearch: playSearchLink(names.get(name)) },
400
+ };
401
+ }
345
402
  const marks = marksByName[index];
346
403
  const apps = appsByName[index];
347
404
  const entities = entitiesByName[index];
@@ -363,9 +420,6 @@ export async function triageNames(inputs, options = {}) {
363
420
  const mark = marks?.[0];
364
421
  const others = marks?.filter(item => letters(item.name) !== letters(mark?.name)) ?? [];
365
422
  const otherMark = others.find(item => item.relevant) ?? others.find(item => item.tier === 'Fuzzy') ?? others[0];
366
- const available = results.filter(row => row.status === 'probably-free' && endings.includes(row.tld));
367
- const recommendable = available.filter(row => canRecommend(row.tld, options.eligible));
368
- const [best] = recommendable;
369
423
  const seen = websiteEndings.flatMap(tld => {
370
424
  const row = results.find(result => result.tld === tld);
371
425
  return tld === 'com' || row?.status === 'taken' ? [[tld, siteEvidence(row, sites[tld])]] : [];
@@ -386,10 +440,11 @@ export async function triageNames(inputs, options = {}) {
386
440
  const us = matchEdgarCompanies(key, edgar);
387
441
  const company = norway?.matches.find(row => row.employees > 0 && row.match === 'exact')
388
442
  ?? us?.matches.find(row => row.match === 'exact');
389
- const sameName = sameNameEvidence({ name: key, live, norway, us, entities, entity, github, handles });
443
+ const sameName = sameNameEvidence({ name: key, live, norway, us, entities, entity, github, handles, deferHandles: options.deferHandles });
390
444
  const otherEntities = entities?.filter(row => !explained.has(row));
391
- const legacy = sameNameEvidence({ name: key, live: unmeasured, norway, us, entities: otherEntities, entity, github, handles });
392
- const silent = silentSources({ marks, apps, android, entities, norway, edgar, github, handles });
445
+ const legacy = sameNameEvidence({ name: key, live: unmeasured, norway, us, entities: otherEntities, entity, github, handles, deferHandles: options.deferHandles });
446
+ const silent = silentSources({ marks, apps, android, entities, norway, edgar, github, handles })
447
+ .filter(source => !options.deferHandles || !['GitHub', 'npm'].includes(source));
393
448
  const otherEntity = otherEntities?.find(row => row.brand) ?? otherEntities?.[0];
394
449
  const [decision, reason] = verdict({
395
450
  rival: tractionVerdict(judged), overlap, sameName: legacy, activeApp,
@@ -402,7 +457,7 @@ export async function triageNames(inputs, options = {}) {
402
457
  const answered = {
403
458
  USPTO: marks, 'App Store': apps, 'Google Play': android, Google: google.google, Wikidata: entities,
404
459
  Brønnøysund: norway, EDGAR: edgar,
405
- ...Object.fromEntries(Object.entries(handles).map(([service, status]) => [service, status === 'unknown' ? null : status])),
460
+ ...!options.deferHandles && Object.fromEntries(Object.entries(handles).map(([service, status]) => [service, status === 'check' ? null : status])),
406
461
  };
407
462
  for (const [source, value] of Object.entries(answered)) coverage(source, value != null);
408
463
  const competition = {
@@ -414,31 +469,21 @@ export async function triageNames(inputs, options = {}) {
414
469
  ...(entity.brand && { brand: true }) } : entities ? [] : null,
415
470
  sameName,
416
471
  };
417
- const requested = results.filter(row => endings.includes(row.tld));
418
472
  return {
419
473
  // Small and dormant same-name uses are notes after the reason; they never change the verdict.
420
474
  name: names.get(name), verdict: decision, reason: [reason, ...tractionNotes(judged)].join(' · '),
421
475
  _free: available, _recommendable: recommendable, _mark: mark, _googleExplained: googleExplained,
422
476
  ...(summary && { traction: summary }),
423
477
  google: { ...(google.google ?? { result: 'not checked', why: google.unchecked }), link: googleSearchLink(names.get(name)) },
424
- taken: requested.filter(row => row.status === 'taken').map(row => row.tld),
425
- shop_check: requested.filter(row => ['check-at-shop', 'reserved'].includes(row.status)).map(row => row.tld),
426
- ...(requested.some(row => row.status === 'reserved') && {
427
- reserved: requested.filter(row => row.status === 'reserved').map(row => row.tld) }),
428
- // Subsets of shop_check with a DNS likelihood; only a registry or shop settles them.
429
- ...likelyEndings(requested),
430
- // Premium endings never carry a list price; the shop shows their price. A short name may be premium.
431
- ...(requested.some(row => row.status === 'premium') && {
432
- premium: requested.filter(row => row.status === 'premium').map(row => row.tld) }),
478
+ ...domainFields,
479
+ _social: compactHandles(social),
433
480
  // The checkout is the listed shop's search, or the confirming shop's search when no list price is known.
434
481
  competition, buy: best ? best.buyUrl ?? shopSearchUrl(best.confirmShop, best.domain) : null,
435
- ...(options.receipt && { _receiptEndings: requested.map(row => ({ domain: row.domain, source: row.source,
436
- checkedAt: row.checkedAt, priceAt: row.priceCheckedAt, shop: row.shop, checkout: row.buyUrl,
437
- site: sites[row.tld], risk: row.premium === 'risk' || row.premiumRisk })) }),
482
+ ...receipt,
438
483
  details: {
439
484
  memorable: memorability(key, names.get(name)),
440
485
  presence: Object.fromEntries(Object.entries(handles).map(([service, status]) =>
441
- [service, status === 'unknown' ? null : status])),
486
+ [service, status === 'check' ? null : status])),
442
487
  sites: Object.fromEntries(seen), appName: appStatus(apps, android),
443
488
  AndroidSearch: android ? null : playSearchLink(names.get(name)),
444
489
  },
@@ -452,18 +497,42 @@ export async function triageNames(inputs, options = {}) {
452
497
  }
453
498
  for (const row of googleCandidates(rows)) row.google.search = true;
454
499
  const sourcesSummary = Object.fromEntries(Object.entries(counts).map(([source, answered]) =>
455
- [source, Math.round(100 * answered / names.size)]));
456
- const receiptDetails = options.receipt ? structuredClone(rows.map(({ competition, details, traction, google, reason, _receiptEndings }) =>
457
- ({ competition, details, traction, google, reason, endings: _receiptEndings }))) : null;
500
+ [source, Math.round(100 * answered / Math.min(names.size, screenLimit))]));
501
+ const receiptDetails = options.receipt ? structuredClone(rows.map(({ competition, details, traction, google, reason, _receiptEndings, _handles }) =>
502
+ ({ competition, details, traction, google, reason, endings: _receiptEndings, handles: _handles }))) : null;
458
503
  const result = packTriage(rows, sourcesSummary, options.compact, endings, options.eligible);
459
504
  if (options.receipt) {
460
505
  result.checkedAt = (options.now ?? new Date()).toISOString();
461
506
  result.priceListDate = domains.priceDate?.slice(0, 10);
462
507
  result.receiptDetails = receiptDetails;
508
+ if (options.deferHandles) {
509
+ const targets = handleOrder(domains.groups, keys, options.eligible).slice(0, handleLimit);
510
+ result.handleTargets = targets.map(name => ({ name, index: [...keys.values()].indexOf(name) }));
511
+ }
463
512
  }
464
513
  return result;
465
514
  }
466
515
 
516
+ // The order the handle rows go in: the person's own name first, then names with a free recommendable ending,
517
+ // cheapest first, then the other screened names in input order.
518
+ export function handleOrder(groups, keys, eligible) {
519
+ const screened = groups.slice(0, screenLimit).map((group, index) => {
520
+ const free = group.results.filter(row => row.status === 'probably-free' && canRecommend(row.tld, eligible))
521
+ .map(row => row.firstPayment ?? Infinity);
522
+ return { key: keys.get(group.name), index, free: free.length > 0, cost: Math.min(...free, Infinity) };
523
+ });
524
+ const [first, ...rest] = screened;
525
+ rest.sort((a, b) => Number(b.free) - Number(a.free) || a.cost - b.cost || a.index - b.index);
526
+ return [first, ...rest].filter(Boolean).map(row => row.key);
527
+ }
528
+
529
+ function compactHandles(entries) {
530
+ if (!Array.isArray(entries)) return null;
531
+ const by = state => entries.filter(entry => entry.state === state).map(entry => entry.platform);
532
+ const [taken, notFound, check] = [by('taken'), by('not-found'), by('check')];
533
+ return { ...(taken.length && { taken }), ...(notFound.length && { not_found: notFound }), ...(check.length && { check }) };
534
+ }
535
+
467
536
  // The first three ranked names, filled from the screened names in input order when fewer than three rank.
468
537
  export function googleCandidates(rows) {
469
538
  const picked = rankedRows(rows).slice(0, 3);
@@ -518,7 +587,9 @@ function topChoices(rows) {
518
587
  function packTriage(rows, sources, compact, endings, eligible) {
519
588
  const prices = {};
520
589
  const top = topChoices(rows);
521
- const names = rows.map(({ _free, _recommendable, _mark, _googleExplained, _receiptEndings, ...row }) => {
590
+ // Handle states for the top names: taken, not_found (no public profile found) or check (check yourself).
591
+ const handles = Object.fromEntries(rows.filter(row => row._social).map(row => [row.name, row._social]));
592
+ const names = rows.map(({ _free, _recommendable, _mark, _googleExplained, _receiptEndings, _handles, _social, ...row }) => {
522
593
  const own = {};
523
594
  for (const option of _free) {
524
595
  const entry = priceEntry(option);
@@ -529,6 +600,7 @@ function packTriage(rows, sources, compact, endings, eligible) {
529
600
  return { ...row, free: _free.map(option => option.tld), own, bestValue: bestValue(_recommendable)?.tld ?? null };
530
601
  });
531
602
  const result = { top, names, prices, sources, eligibility: eligibilityNotes(endings),
603
+ ...(Object.keys(handles).length && { handles }),
532
604
  ...(eligible?.length && { eligible }),
533
605
  ...(!compact && names.length <= 5 && { trademarkSearches, handleSearches }) };
534
606
  const limit = names.length <= 5 ? (compact ? 5600 : 5999) : compact ? 9150 : 9850;
@@ -538,6 +610,10 @@ function packTriage(rows, sources, compact, endings, eligible) {
538
610
  if (size() > limit) for (const row of names) row.buy = null;
539
611
  }
540
612
  for (const trim of [
613
+ // Platforms not listed under taken or not_found are "check yourself"; the results page lists them all.
614
+ () => { for (const value of Object.values(result.handles ?? {})) delete value.check; },
615
+ // GitHub and npm stand in the handle states and the same-name summary too.
616
+ row => { if (row.details) delete row.details.presence; },
541
617
  row => { row.details = null; },
542
618
  row => { row.buy = null; },
543
619
  row => { if (row.traction) delete row.traction.geo; },
@@ -560,6 +636,8 @@ function packTriage(rows, sources, compact, endings, eligible) {
560
636
  if (typeof row.competition.US === 'string') row.competition.US = row.competition.US.split(':', 1)[0];
561
637
  row.reason = row.reason.split(' · ', 1)[0];
562
638
  },
639
+ // Last: the results page and say keep the full handle rows.
640
+ () => { delete result.handles; },
563
641
  ]) {
564
642
  if (size() <= limit) break;
565
643
  names.forEach(trim);
package/display.mjs CHANGED
@@ -28,7 +28,7 @@ const money = value => '$' + Number(value).toFixed(2);
28
28
  // The DNS label of a screened name: punycode for æøå, never with letters removed.
29
29
  const label = name => normalizeName(String(name ?? '')) ?? String(name ?? '').normalize('NFKD').toLowerCase().replace(/[^a-z0-9-]/g, '');
30
30
  const fullDomain = (name, d) => d.includes('.') ? d : name + '.' + d;
31
- const suffix = domain => domain.split('.').at(-1);
31
+ const suffix = domain => domain.endsWith('.co.uk') || domain === 'co.uk' ? 'co.uk' : domain.split('.').at(-1);
32
32
  const registered = (row, ending) => row.taken?.includes(ending) || row.resale?.includes(ending);
33
33
  const checkoutLimitation = 'Domain Hound cannot buy or complete checkout.';
34
34
  const mayBePremium = 'may be premium, price at shop';
@@ -157,7 +157,7 @@ function exactDisplay(result) {
157
157
  const row = result.names?.[0] ?? {};
158
158
  const domain = row.name;
159
159
  const name = shown(domain);
160
- const ending = domain.split('.').at(-1);
160
+ const ending = suffix(domain);
161
161
  const checked = result.checkedAt ? ' Checked ' + String(result.checkedAt).slice(0, 16).replace('T', ' ') + ' UTC.' : '';
162
162
  const others = otherEndingsLine(result);
163
163
  const tail = others ? [others] : [];
@@ -355,7 +355,7 @@ export function checkDisplay(result, level = 0, purchase = false) {
355
355
  } else if (rows.length === 1 || purchase) {
356
356
  const available = rows.flatMap(row => (row.free ?? []).flatMap(option => {
357
357
  const domain = option.d.includes('.') ? option.d : row.name.includes('.') ? row.name : row.name + '.' + option.d;
358
- if (!canRecommend(domain.split('.').at(-1), eligible)) return [];
358
+ if (!canRecommend(suffix(domain), eligible)) return [];
359
359
  const price = option.prem || option.s === 'prem' ? option : { ...listPrices[option.d], ...option };
360
360
  const link = templateLink(result.buyUrlTemplate, price.shop, domain);
361
361
  return link ? [{ link, price: price.now ?? Infinity }] : [];
@@ -526,8 +526,10 @@ function denseDisplay(result, short = false, links = true) {
526
526
  const names = results.map(row => '- **' + nameLabel(row.name) + '** — ' + md(row.verdict));
527
527
  const individual = names.map((name, index) => name + ' \n ' + checksFor(results[index]).join(' \n '));
528
528
  const groups = links ? [] : groupRows(results, checksFor);
529
+ // A long group names its first and last name, so twenty long labels do not repeat in every heading.
529
530
  const shared = groups.flatMap(({ names, lines }) => [
530
- names.length === results.length ? '**Search checks for every name**' : names.join(', '), ...lines,
531
+ names.length === results.length ? '**Search checks for every name**'
532
+ : names.length > 5 ? names.length + ' names, ' + names[0] + ' to ' + names.at(-1) : names.join(', '), ...lines,
531
533
  ]);
532
534
  const rows = shared.length && bytes([...names, ...shared].join('\n')) < bytes(individual.join('\n'))
533
535
  ? [...names, '', ...shared] : individual;
@@ -551,6 +553,7 @@ const progressStage = {
551
553
  quotes: 'Registry checks are in; shop prices are being checked.',
552
554
  browser: 'The live shop check is running.',
553
555
  rivals: 'Domain checks are in; trademark, app and rival checks are still running.',
556
+ handles: 'Domain checks are in; handles for the top three names are being checked.',
554
557
  };
555
558
 
556
559
  // The answer when a lookup outlasts this call's budget: what the registries have answered so far, the elapsed
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "domain-hound",
3
- "version": "0.1.4",
4
- "description": "Check domains, compare registrar prices, and screen product names from your MCP client.",
3
+ "version": "0.1.5",
4
+ "description": "Find a startup name and domain you can actually buy: availability, prices, app names, trademarks. MCP for Claude Code and Codex.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -17,9 +17,21 @@
17
17
  },
18
18
  "keywords": [
19
19
  "mcp",
20
- "domains",
20
+ "mcp-server",
21
21
  "claude",
22
- "codex"
22
+ "claude-code",
23
+ "codex",
24
+ "domain",
25
+ "domain-availability",
26
+ "domain-name",
27
+ "startup-name",
28
+ "naming",
29
+ "trademark",
30
+ "app-name",
31
+ "whois",
32
+ "rdap",
33
+ "registrar",
34
+ "domain-prices"
23
35
  ],
24
36
  "mcpName": "dev.domainhound/domain-hound",
25
37
  "files": [
@@ -35,6 +47,7 @@
35
47
  "clis/domain-check/confirm.mjs",
36
48
  "clis/domain-check/google-play.mjs",
37
49
  "clis/domain-check/google-search.mjs",
50
+ "clis/domain-check/handles.mjs",
38
51
  "clis/domain-check/index.mjs",
39
52
  "clis/domain-check/name-search.mjs",
40
53
  "clis/domain-check/naming-method.mjs",
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "domain-hound",
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "description": "Check domain availability and prices, and screen product names, from your AI assistant.",
6
6
  "author": {
7
7
  "name": "Lars Hvinden"