domain-hound 0.1.15 → 0.1.17

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,7 +4,7 @@
4
4
  "plugins": [
5
5
  {
6
6
  "name": "domain-hound",
7
- "version": "0.1.15",
7
+ "version": "0.1.17",
8
8
  "source": { "source": "local", "path": "./" },
9
9
  "policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" },
10
10
  "category": "Productivity"
@@ -5,7 +5,7 @@
5
5
  "plugins": [
6
6
  {
7
7
  "name": "domain-hound",
8
- "version": "0.1.15",
8
+ "version": "0.1.17",
9
9
  "source": "./",
10
10
  "description": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track.",
11
11
  "relevance": { "topic": "Domains", "signals": { "hosts": ["rdap.org", "porkbun.com"] } }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "domain-hound",
3
3
  "displayName": "Domain Hound",
4
- "version": "0.1.15",
4
+ "version": "0.1.17",
5
5
  "description": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track.",
6
6
  "author": {
7
7
  "name": "Lars Hvinden"
package/README.md CHANGED
@@ -60,10 +60,10 @@ Then ask, for example: “Is lanternbay.com available?”, “Find a name for my
60
60
 
61
61
  ## Find and check
62
62
 
63
- The Claude Code and Codex plugins include a `domains` skill for availability, price comparisons, purchases and release watches. The `naming` skill covers naming a product, company or app.
63
+ The Claude Code and Codex plugins include one `domain-hound` skill for domain searches, price comparisons, naming, purchases and release watches.
64
64
 
65
65
  The package uses the same hosted search as [domainhound.dev](https://domainhound.dev). `check_domains` compares ten
66
- endings by default: .com, .ai, .io, .dev, .co, .so, .sh, .inc, .tech and .app. A typed domain checks that exact ending.
66
+ endings by default: .com, .ai, .io, .dev, .app, .co, .so, .sh, .tech and .inc. A typed domain checks that exact ending.
67
67
  An affordable .inc result appears in a bare-name search only after the registry confirms availability.
68
68
 
69
69
  Each available domain shows the listed shops, first-year price, renewal and three-year cost, plus the cheapest shop
@@ -78,9 +78,10 @@ If `check_domains` says a check is pending, repeat the same call to collect it.
78
78
 
79
79
  When the hosted lookup cannot check a .dev or .app domain, the package can ask Google Registry from your device and pass the result back to the hosted service to calculate the pick. It also tries Apple from your device when the hosted App Store lookup is rate-limited.
80
80
 
81
- Pass `idea` to `triage_names` to generate names on the same service. The results page updates as the checks finish.
82
- Pass `names` to screen names you already have. For a second generation round, pass the same `idea` with the `wanted`
83
- and `avoid` names and the next `round` number.
81
+ Pass `idea` to `triage_names` to find checked names. The results page updates as screening finishes.
82
+ Pass `names` to screen existing names. For another naming round, send the same `idea`, the previous `shown` names,
83
+ your updated `taste` and the latest `feedback`. Add `proposals` with up to 20 host-written candidates per call
84
+ to use the same checks on your own ideas. Use `pick` with a previously shown name to recheck one winner.
84
85
 
85
86
  Set `DOMAIN_HOUND_API_URL` to use a different HTTPS API origin or a loopback HTTP origin for development. The package
86
87
  retries a transient check failure once. If the hosted check is still running when the tool returns, repeat the same call
@@ -105,7 +106,10 @@ Use `check_domains` for one exact domain or up to 20 names or domains. Use `tria
105
106
 
106
107
  ### Naming skill and Name score
107
108
 
108
- Brainstorm names all day. If they're not available, it's pointless. The naming skill gives your agent one method: subject words, six territories, five recipes (odd pair, pun, blend, insider term, phrase or character), hard bans, and one steering question: "Which two do you love, and which one do you hate?" The Claude Code plugin ships it as `skills/naming/SKILL.md`; any MCP client gets the same method from `naming_guide`.
109
+ The Claude Code plugin ships one skill at `skills/domain-hound/SKILL.md`. It walks through the best domain
110
+ and price, the best alternative if it is taken, a possible rebrand, and a name that will still fit as the business grows.
111
+ Any MCP client can get the method from `naming_guide`. Generated names include a short reason linking a familiar
112
+ word or image to the business. New ideas are shown after the domain, app stores and exact US trademark checks finish.
109
113
 
110
114
  `triage_names` gives each of the first five names a **Name score**, 0 to 100: how clear the road is. It is not a probability. Points come from the best available ending (22), its 3-year price (3), trademarks (25), rivals (20), apps (8), handles (7) and name quality (15). Bans (digits, hyphens, -ly, -ify, -io, AI, GPT, bot, smart, generic words like hub or labs, over 12 letters) and hard filters (no available ending within $60 over 3 years, an identical live trademark in your classes, a strong same-name rival in your subject, a severe bad meaning) run first, in code; those names get no score and are never a pick. A check that failed counts 40% of its points and says "Not checked". Trademarks stay at 20 of 25 until the EU office answers. A failed US trademark or rival check keeps the total at 79 or less, and so does missing `candidates` evidence for the bans code cannot judge on its own. Bands: 80+ Strong, 60 to 79 Workable, 40 to 59 Risky, under 40 Advise against. Picks rank by score. Each scored name shows up to three reasons. The hosted generator includes its own Name score in each suggestion. A local bare-name lookup can also provide a preliminary score.
111
115
 
@@ -189,7 +193,7 @@ Quotes, transfer quotes, DNS plans, order and transfer claims and receipts stay
189
193
 
190
194
  ## Privacy and lookup hosts
191
195
 
192
- Hosted checks send the name or domain to Domain Hound. A hosted naming round sends its idea and steering words to
196
+ Hosted checks send the name or domain to Domain Hound. A hosted naming round sends its brief, proposals and conversation notes to
193
197
  Domain Hound and Cloudflare Workers AI. Set `DOMAIN_HOUND_LOCAL=1` for local lookups. Local lookups share candidates
194
198
  with public evidence sources. Catalog downloads carry no candidate name. Clicking a results link sends the name in that link.
195
199
 
@@ -1,3 +1,4 @@
1
+ import { domainTier } from '../../name-context.mjs';
1
2
  import { domainToASCII, domainToUnicode } from 'node:url';
2
3
  import { checkDomainSite } from './com-site.mjs';
3
4
  import { cachedSignals, confirmingShops } from './confirm.mjs';
@@ -76,15 +77,16 @@ function fitsCap(option, { budget } = {}) {
76
77
  // The one pick rule. options are free, eligible, in-scope rows shaped { domain, now, total } (total = payments due in
77
78
  // 3 years). The pick is the highest-quality option within the cap; when none fits, the least paid over 3 years.
78
79
  // .ai is never the default: only when the person asked for it or its 3-year total fits the budget they gave.
79
- export function choosePick(options, { requested = [], eligible = [], budget, allowOverCap = true } = {}) {
80
- const allowed = options.filter(option => domainEnding(option.domain) !== 'ai' || asked(option.domain, requested) >= 0
81
- || (budget != null && known(option.total) && cents(option.total) <= cents(budget)));
80
+ export function choosePick(options, { requested = [], eligible = [], budget, allowOverCap = true, exactLabel, upfrontCap } = {}) {
81
+ const allowed = options.filter(option => (upfrontCap == null || (known(option.now) && cents(option.now) <= cents(upfrontCap))) &&
82
+ (exactLabel || domainEnding(option.domain) !== 'ai' || asked(option.domain, requested) >= 0
83
+ || (budget != null && known(option.total) && cents(option.total) <= cents(budget))));
82
84
  const rank = option => qualityRank(option.domain, requested, eligible);
83
- // A name variation (getexample.com) ranks after every exact ending.
84
- const byQuality = (a, b) => Number(a.exact === false) - Number(b.exact === false) || rank(a) - rank(b)
85
+ const byQuality = (a, b) => (exactLabel ? domainTier(a.domain, exactLabel) - domainTier(b.domain, exactLabel)
86
+ : Number(a.exact === false) - Number(b.exact === false)) || rank(a) - rank(b)
85
87
  || (a.total ?? Infinity) - (b.total ?? Infinity)
86
88
  || (a.now ?? Infinity) - (b.now ?? Infinity) || a.domain.localeCompare(b.domain);
87
- return allowed.filter(option => fitsCap(option, { budget })).sort(byQuality)[0]
89
+ return allowed.filter(option => upfrontCap != null ? known(option.total) : fitsCap(option, { budget })).sort(byQuality)[0]
88
90
  ?? (allowOverCap ? lowestTotal(allowed, rank) : undefined);
89
91
  }
90
92
 
@@ -12,41 +12,25 @@ 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
- // 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
- };
15
+ export const steeringQuestion = 'Which word would you keep, and what do you like about another name?';
16
+ const shortText = text => text.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu, ' ').trim();
28
17
 
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'
33
- + (about ? '1. Brief: ' + about.replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu, ' ').trim()
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: Show the tool’s answer as given. Keep the results link. Offer details only if the user asks. '
42
- + 'If fewer than five pass, never pad. '
43
- + 'The results page updates as checks finish.\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() + '.';
18
+ export const namingRecipe = (about = '') => [
19
+ 'Naming recipe from Domain Hound',
20
+ about ? 'Brief: ' + shortText(about) : 'Ask once if the brief is missing: What does it do, for whom, in one sentence?',
21
+ '1. Best domain: check the exact name and report the best ending, upfront price and renewal.',
22
+ '2. Best alternative: try other suitable endings for the same name and choose the strongest available one.',
23
+ '3. Rebrand: picture a real customer moment. Explore six territories: the job, result, familiar metaphor, object or place, role, and real-word twist.',
24
+ 'A compound can work in any territory if both words add meaning. Write roughly 25 ideas per territory. Try Glean’s verb, Sentry’s watchful role or Dropbox’s everyday action as patterns.',
25
+ 'Cut names that fail truth, recognition, connection, say-and-spell or recall. Prefer two syllables. Reject category mash-ups, forced spelling and generic endings such as -ify or -hub.',
26
+ 'Give each name a plain reason of at most 16 words naming the familiar anchor and its link to the work.',
27
+ 'Call triage_names with idea and groups of up to 20 proposals. The territory field must be exactly one of: job, result, metaphor, object, role, twist.',
28
+ 'Set anchor to a familiar word appearing in the name, and repeat it in why. Send name, territory, anchor, why and optional parents. Use the original business brief as idea.',
29
+ 'Collect final results before answering. If a batch is still checking, call triage_names again with the same input.',
30
+ 'Use the tool’s final checks. Show up to five names from different territories on the first round, each with why, domain, price now and at renewal, apps, and the US trademark result.',
31
+ '4. A name that lasts: pick an easy-to-recall checked name that can grow beyond the first feature. Name any screen still needed for the audience.',
32
+ 'When the founder is still exploring, ask: ' + steeringQuestion,
33
+ 'Keep exact liked words and remember sounds, images, tone, rejected patterns, parent names and all ideas already shown.',
34
+ 'Send updated taste, shown names, and the latest feedback on the next call. Keep one word intact and borrow the other idea’s feeling or shape. Give up to three fresh names.',
35
+ 'After three rounds compare the best three checked names. If asked to choose sooner, send pick with the selected name and its shown details to recheck it.',
36
+ ].join('\n');
@@ -8,7 +8,7 @@ import { withShopPages } from './confirm.mjs';
8
8
  import { catalogPrice, dynadotOffer, offer, shops } from './prices.mjs';
9
9
 
10
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'];
11
+ export const targetEndings = ['com', 'ai', 'io', 'dev', 'app', 'co', 'so', 'sh', 'tech', 'inc'];
12
12
  export const requestEndings = ['me', 'si', 'no', 'xyz', 'net', 'org', 'gg', 'studio', 'se', 'dk', 'de', 'uk', 'co.uk', 'eu'];
13
13
  export const supportedEndings = [...targetEndings, ...requestEndings];
14
14
  // Older on-disk snapshots used these required entries. Keep reading them on the local fallback path.
@@ -28,6 +28,16 @@ const automaticShops = ['porkbun', 'dynadot'];
28
28
  const refreshMarker = 'price-refresh.attempt';
29
29
  const pricingPage = 'https://www.spaceship.com/domain-search/pricing/';
30
30
 
31
+ export function priceEvidenceUrl(shop, ending) {
32
+ return ({
33
+ Spaceship: pricingPage,
34
+ Dynadot: 'https://www.dynadot.com/domain/prices?currency=USD',
35
+ Porkbun: 'https://porkbun.com/products/domains',
36
+ Cloudflare: 'https://pricing.registrar.cloudflare.com/',
37
+ Gandi: 'https://www.gandi.net/en/domain/tld/' + encodeURIComponent(ending) + '?currency=USD',
38
+ })[shop] ?? null;
39
+ }
40
+
31
41
  function validPrice(row, shop) {
32
42
  return row?.shop === shop && typeof row.firstYear === 'number' && typeof row.renewal === 'number' &&
33
43
  catalogPrice(row.firstYear) !== null && catalogPrice(row.renewal) !== null;
@@ -0,0 +1,159 @@
1
+ import { lookupAtomListing } from './clis/domain-check/broker-atom.mjs';
2
+ import { readList } from './clis/portfolio/store.mjs';
3
+ import { playSearchLink } from './clis/domain-check/google-play.mjs';
4
+ import { searchApps, searchMarks } from './clis/domain-check/triage-sources.mjs';
5
+ import { checkGooglePlayNames, checkSocialHandles } from './clis/domain-check/handles.mjs';
6
+ import { companyRequest, isParkingHost, marketplace, readCompanies, readEntities, readRegistration, readSitePage,
7
+ sourceUrl, wikiRequest } from './name-context.mjs';
8
+ import { bootstrapUrl, rdapBase, rdapDomainUrl, documentedWhois } from './clis/domain-check/registry.mjs';
9
+ import { followSite } from './clis/domain-check/safe-web.mjs';
10
+ import { priceEvidenceUrl } from './clis/domain-check/price-catalog.mjs';
11
+ import { searchCandidates } from './clis/domain-check/name-search.mjs';
12
+
13
+ export function registrySource(domain, ending, method) {
14
+ if (method === 'dns' || method?.startsWith('dns')) {
15
+ return 'https://cloudflare-dns.com/dns-query?' + new URLSearchParams({ name: domain, type: 'NS' });
16
+ }
17
+ if (method === 'whois' || method?.startsWith('whois')) {
18
+ const provider = documentedWhois.get(ending);
19
+ return provider ? 'whois://' + provider : null;
20
+ }
21
+ if (method === 'web') return 'https://' + domain + '/';
22
+ if (!method?.startsWith('rdap')) return null;
23
+ const base = rdapBase(ending) ?? ({
24
+ com: 'https://rdap.verisign.com/com/v1/',
25
+ ai: 'https://rdap.identitydigital.services/rdap/',
26
+ app: 'https://pubapi.registry.google/rdap/',
27
+ dev: 'https://pubapi.registry.google/rdap/',
28
+ })[ending];
29
+ return base ? rdapDomainUrl(base, domain) : bootstrapUrl;
30
+ }
31
+
32
+ async function boundedJson(url, signal, fetcher) {
33
+ if (!url) return null;
34
+ try {
35
+ const response = await fetcher(url, {
36
+ headers: { 'user-agent': 'DomainHound (+https://domainhound.dev)', accept: 'application/json, application/rdap+json' },
37
+ redirect: 'error', credentials: 'omit', signal,
38
+ });
39
+ if (!response.ok) {
40
+ await response.body?.cancel();
41
+ return null;
42
+ }
43
+ const reader = response.body?.getReader();
44
+ if (!reader) return null;
45
+ try {
46
+ const decoder = new TextDecoder();
47
+ let body = '';
48
+ let bytes = 0;
49
+ for (;;) {
50
+ const { done, value } = await reader.read();
51
+ if (done) return JSON.parse(body + decoder.decode());
52
+ bytes += value.length;
53
+ if (bytes > 180_000) return null;
54
+ body += decoder.decode(value, { stream: true });
55
+ }
56
+ } finally {
57
+ await reader.cancel().catch(() => {});
58
+ }
59
+ } catch {
60
+ return null;
61
+ }
62
+ }
63
+
64
+ async function domainSite(domain, options) {
65
+ const start = 'https://' + domain + '/';
66
+ const read = scheme => followSite(scheme + '://' + domain + '/', {
67
+ ...options, stopAt: url => marketplace(url) ? 'marketplace' : isParkingHost(url) ? 'parking' : null,
68
+ });
69
+ const evidence = result => {
70
+ const checkedAt = new Date().toISOString();
71
+ if (result.stopped?.url && result.hops.length) {
72
+ const url = result.stopped.url;
73
+ const market = marketplace(url);
74
+ const path = url.pathname.toLowerCase().split('/').filter(Boolean);
75
+ const bound = path.includes(domain) || url.searchParams.get('domain')?.toLowerCase() === domain ||
76
+ (market === 'Atom' && path[0] === 'name' && path[1] === domain.slice(0, -4));
77
+ if (market || isParkingHost(url)) return { state: !market ? 'parked' : bound ? 'for-sale' : 'redirect', host: url.hostname,
78
+ url: sourceUrl(url), checkedAt, ...(market && bound && { marketplace: market }) };
79
+ }
80
+ const page = result.final;
81
+ if (page?.status === 200 && page.body) return readSitePage(domain, page.url, page.body, checkedAt, { complete: !page.truncated });
82
+ const target = result.failed?.url ?? result.stopped?.url ?? page?.url;
83
+ return { state: target && ![domain, 'www.' + domain].includes(target.hostname) ? 'redirect' : 'unconfirmed',
84
+ ...(target && { host: target.hostname }), url: start, checkedAt };
85
+ };
86
+ const https = evidence(await read('https'));
87
+ return https.state === 'unconfirmed' && !options.signal.aborted ? evidence(await read('http')) : https;
88
+ }
89
+
90
+ async function candidateRows(labels, endings, variant) {
91
+ const candidates = labels.flatMap(name => endings.map(tld => ({ domain: name + '.' + tld, tld, exact: !variant })));
92
+ if (!candidates.length) return [];
93
+ const { groups } = await searchCandidates([{ candidates }], { budgetMs: 3500, cachedOnly: true, skipComSite: true });
94
+ return groups[0].results.map(row => {
95
+ const status = ['confirmed', 'probably-free', 'premium'].includes(row.status) ? 'available' : row.status === 'taken' ? 'taken' : 'unknown';
96
+ return { domain: row.domain, ending: row.tld, status, variant, premium: row.premium,
97
+ checkedAt: row.checkedAt, source: registrySource(row.domain, row.tld, row.source), evidence: row.source,
98
+ reason: row.status === 'reserved' ? 'reserved' : null, prices: status === 'available' && !row.premium && row.price != null ? [{
99
+ shop: row.shop, firstYearUsd: row.price, firstPaymentUsd: row.firstPayment, minimumYears: row.minimumYears,
100
+ renewalUsd: row.renewal, renewalPaymentUsd: row.renewalPayment, threeYearUsd: row.threeYear,
101
+ checkedAt: row.priceCheckedAt, source: row.status === 'confirmed' ? row.buyUrl : priceEvidenceUrl(row.shop, row.tld) ?? row.buyUrl, buyUrl: row.buyUrl,
102
+ needsCloudflareDns: row.shop === 'Cloudflare',
103
+ }] : [] };
104
+ });
105
+ }
106
+
107
+ export function publicSources({ fetcher = globalThis.fetch, env = process.env } = {}) {
108
+ return {
109
+ async owned() {
110
+ return (await readList()).domains;
111
+ },
112
+ async names(name, label) {
113
+ const signal = AbortSignal.timeout(2800);
114
+ const wiki = wikiRequest(name);
115
+ const companies = companyRequest(name);
116
+ const [wikidata, brreg, handles] = await Promise.all([
117
+ boundedJson(wiki, signal, fetcher), boundedJson(companies, signal, fetcher),
118
+ checkSocialHandles([{ name: label, platforms: ['LinkedIn'] }], { env, fetcher, signal }).catch(() => null),
119
+ ]);
120
+ const checkedAt = new Date().toISOString();
121
+ const entities = readEntities(wikidata, name, checkedAt);
122
+ const matches = readCompanies(brreg, name, checkedAt);
123
+ return { entities, companies: matches, linkedin: handles?.get(label)?.find(row => row.platform === 'LinkedIn'), lookups: [
124
+ { url: wiki, checkedAt, status: entities ? 'checked' : 'unconfirmed' },
125
+ { url: companies, checkedAt, status: matches ? 'checked' : 'unconfirmed' },
126
+ ] };
127
+ },
128
+ async domain(domain) {
129
+ const signal = AbortSignal.timeout(3800);
130
+ const url = registrySource(domain, 'com', 'rdap');
131
+ const [site, registry, info] = await Promise.all([
132
+ domainSite(domain, { signal }), boundedJson(url, signal, fetcher), lookupAtomListing(domain, { signal, fetcher }),
133
+ ]);
134
+ const listing = { state: info.status, name: 'Atom', url: info.listingUrl ?? info.url,
135
+ sourceUrl: info.url, checkedAt: info.checkedAt, ...(info.price && ['USD', 'EUR', 'GBP'].includes(info.price.currency) && { price: info.price }) };
136
+ return { domain, site, registration: readRegistration(registry, domain, url, new Date().toISOString()), listing };
137
+ },
138
+ variants: (labels, endings) => candidateRows(labels, endings, true),
139
+ comparison: (label, endings) => candidateRows([label], endings, false),
140
+ async localChecks(name, label) {
141
+ const signal = AbortSignal.timeout(2800);
142
+ const [apps, play, marks] = await Promise.all([
143
+ searchApps(label, name, { signal, fetcher }).catch(() => null),
144
+ checkGooglePlayNames([name], { signal, fetcher, env }).catch(() => null),
145
+ searchMarks(label, name, { signal, fetcher }).catch(() => null),
146
+ ]);
147
+ const checkedAt = new Date().toISOString();
148
+ const exact = (marks ?? []).filter(row => row.tier === 'Exact').map(row => ({ ...row, mark: row.name }));
149
+ const playRow = play?.get(name);
150
+ return {
151
+ appStore: { status: !apps ? 'unknown' : apps.length ? 'taken' : 'no_match_found',
152
+ checkedAt: apps ? checkedAt : null, matches: apps ?? [] },
153
+ googlePlay: { status: playRow?.state ?? 'unknown', link: playSearchLink(name), checkedAt: playRow?.checkedAt ?? null },
154
+ // This local endpoint includes fuzzy hits and can truncate the result set. Positive exact matches are usable.
155
+ trademarks: { us: { status: exact.length ? 'exact_match_found' : 'unknown', marks: exact, checkedAt: exact.length ? checkedAt : null } },
156
+ };
157
+ },
158
+ };
159
+ }
@@ -165,6 +165,7 @@ export function hostedChecks(checks, args, triage = false) {
165
165
  export function generatedChecks(generation) {
166
166
  return generation.names.map(entry => ({
167
167
  query: { name: entry.name, exactDomain: null },
168
+ why: entry.why,
168
169
  domains: entry.domains,
169
170
  choice: { pick: entry.domain },
170
171
  nameChecks: entry.nameChecks,
@@ -198,12 +199,13 @@ export function hostedResult(checks, args, generation, { pending = false, failed
198
199
  ? ['Dated list prices in USD before tax · ' + md((generation?.priceSnapshot ?? checks[0].priceSnapshot).checkedAt.slice(0, 10))] : []),
199
200
  ];
200
201
  const names = checks.map(check => {
202
+ const key = row => row.variant ? row.domain : row.ending;
201
203
  const rows = status => check.domains.filter(row => row.status === status);
202
204
  return { name: check.query.exactDomain ?? check.query.name,
203
- available: rows('available').map(row => row.ending), free: rows('available').map(row => ({ d: row.ending })),
204
- taken: rows('taken').map(row => row.ending),
205
- reserved: rows('unknown').filter(row => row.reason === 'reserved').map(row => row.ending),
206
- shop_check: rows('unknown').filter(row => row.reason !== 'reserved').map(row => row.ending),
205
+ available: rows('available').map(key), free: rows('available').map(row => ({ d: key(row) })),
206
+ taken: rows('taken').map(key),
207
+ reserved: rows('unknown').filter(row => row.reason === 'reserved').map(key),
208
+ shop_check: rows('unknown').filter(row => row.reason !== 'reserved').map(key),
207
209
  ...(check.score && { score: check.score }) };
208
210
  });
209
211
  const { details, ...generationResult } = generation ?? {};
package/hosted.mjs CHANGED
@@ -196,7 +196,7 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
196
196
  }
197
197
 
198
198
  return {
199
- async check(name, extraEndings, signal, onDomains) {
199
+ async check(name, extraEndings, signal, onDomains, { compareExact } = {}) {
200
200
  const [main, ...extras] = await Promise.all([get(name, signal),
201
201
  ...extraEndings.map(ending => get(normalizeName(name) + '.' + ending, signal))]);
202
202
  const { details, ...answer } = main;
@@ -212,7 +212,7 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
212
212
  if (comparison) answer[alternativeEndings] = withInc(inc);
213
213
  answer.complete = main.complete && extras.every(extra => extra.complete);
214
214
  const exact = main.query.exactDomain;
215
- const needsAlternatives = exact && main.domains.length === 1 && main.domains[0].domain === exact && main.domains[0].status === 'taken';
215
+ const needsAlternatives = exact && main.domains.length === 1 && main.domains[0].domain === exact && (main.domains[0].status === 'taken' || compareExact?.(main.domains[0]));
216
216
  // Run alongside the name checks. An unavailable comparison must not discard the exact answer.
217
217
  const alternatives = needsAlternatives ? get(main.query.ascii, signal).then(comparison =>
218
218
  comparison.query.ascii === main.query.ascii ? {
@@ -255,7 +255,9 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
255
255
  },
256
256
 
257
257
  async generate(args, signal) {
258
- const generation = await read('/v1/generate', { body: args, timeout: 9400, signal });
258
+ const { proposals, ...input } = args;
259
+ const path = proposals ? '/v1/naming/batch' : '/v1/generate';
260
+ const generation = await read(path, { body: { ...input, ...(proposals && { candidates: proposals }) }, timeout: 9400, signal });
259
261
  if (!validGeneration(generation)) throw new Error('Invalid hosted generation');
260
262
  if (generation.stage === 'final') await recoverNameChecks(generation.names, signal);
261
263
  return generation;