domain-hound 0.1.8 → 0.1.9
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 +43 -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 +21 -6
- package/clis/domain-check/name-score.mjs +348 -0
- package/clis/domain-check/name-search.mjs +2 -4
- 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 +21 -17
- package/dossier.mjs +1 -1
- package/hosted-results.mjs +157 -0
- package/hosted.mjs +164 -0
- package/package.json +8 -1
- package/plugin.json +1 -1
- package/results-style.mjs +3 -0
- package/results.mjs +111 -44
- package/server.json +2 -2
- package/server.mjs +190 -17
- package/share.mjs +15 -5
- package/site/r/share-format.mjs +16 -5
- package/skills/naming/SKILL.md +76 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { attributed, md } from './display.mjs';
|
|
2
|
+
import { canRecommend, choosePick, normalizeName } from './clis/domain-check/name-search.mjs';
|
|
3
|
+
import { compareScores, scoreEligible, scoreHandles, scoreName } from './clis/domain-check/name-score.mjs';
|
|
4
|
+
import { relevantClasses } from './clis/domain-check/triage-sources.mjs';
|
|
5
|
+
import { handleLabel, handleStates } from './clis/domain-check/handles.mjs';
|
|
6
|
+
import { googlePlayLabel, googlePlayLinkLabel, playSearchLink } from './clis/domain-check/google-play.mjs';
|
|
7
|
+
|
|
8
|
+
const money = value => Number.isFinite(value) ? '$' + value.toFixed(2) : 'price at shop';
|
|
9
|
+
const platforms = ['LinkedIn', 'X', 'Instagram', 'TikTok', 'YouTube', 'Threads', 'Facebook', 'Reddit', 'Twitch', 'GitHub'];
|
|
10
|
+
|
|
11
|
+
function link(label, value) {
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(value);
|
|
14
|
+
if (url.protocol === 'https:' && !url.username && !url.password) {
|
|
15
|
+
return '[' + md(label) + '](' + url.href.replaceAll('(', '%28').replaceAll(')', '%29') + ')';
|
|
16
|
+
}
|
|
17
|
+
} catch { /* A source without a public link still has a label. */ }
|
|
18
|
+
return md(label);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function warning(check) {
|
|
22
|
+
const us = check.nameChecks?.trademarks?.us;
|
|
23
|
+
if (us?.status !== 'exact_match_found') return [];
|
|
24
|
+
if (!us.marks.length) return ['US trademark warning for ' + md(check.query.name) + '. An exact live match was found.'];
|
|
25
|
+
return us.marks.map(mark => 'US trademark warning for ' + link(mark.mark, mark.url ?? us.searchUrl)
|
|
26
|
+
+ (mark.owner ? '. ' + md(mark.owner) + (mark.status === 'applied' ? ' applied for this mark' : ' is listed as the owner') : '')
|
|
27
|
+
+ '. The match applies to the name across all endings.');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function nameCheckLines(details, pending, name) {
|
|
31
|
+
if (!details) return [pending ? 'Name checks are still running.' : 'Name checks could not be completed.'];
|
|
32
|
+
const { appStore: app, googlePlay, trademarks, handles } = details;
|
|
33
|
+
const appText = app.status === 'taken' ? 'Matching app found' : app.status === 'no_match_found' ? 'No matching app found'
|
|
34
|
+
: app.reason === 'rate-limited' ? 'Search rate-limited' : 'Could not complete the search';
|
|
35
|
+
const apps = app.matches?.map(match => link(match.name, match.url)).join(', ');
|
|
36
|
+
const us = trademarks?.us;
|
|
37
|
+
const markText = us?.status === 'no_exact_match_found' ? 'No exact live match found' : us?.status === 'unknown'
|
|
38
|
+
? "Couldn't check · " + link('Search US trademarks', us.searchUrl) : null;
|
|
39
|
+
return [
|
|
40
|
+
...(markText ? ['US trademarks · ' + markText] : []),
|
|
41
|
+
'App Store · ' + appText + (apps ? ' · ' + apps : ''),
|
|
42
|
+
(googlePlay.why === 'no public search' ? googlePlayLabel : 'Google Play · ' + (handleStates[googlePlay.status] ?? handleStates.unknown))
|
|
43
|
+
+ ' · ' + link(googlePlayLinkLabel, googlePlay.link ?? playSearchLink(name)),
|
|
44
|
+
...platforms.flatMap(platform => {
|
|
45
|
+
const handle = handles.find(row => row.platform === platform);
|
|
46
|
+
if (!handle) return [];
|
|
47
|
+
const label = handleLabel(handle);
|
|
48
|
+
return platform + ' · ' + (handle.linkLabel ? label + ' · ' + link(handle.linkLabel, handle.link) : link(label, handle.link));
|
|
49
|
+
}),
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function priceLine(offer, cheapest) {
|
|
54
|
+
const term = offer.minimumYears > 1 ? ' · ' + money(offer.firstPaymentUsd) + ' upfront for ' + offer.minimumYears + ' years' : '';
|
|
55
|
+
return link(offer.shop, offer.buyUrl) + (cheapest ? ' (cheapest over three years)' : '') + ' · '
|
|
56
|
+
+ money(offer.firstYearUsd) + ' first year · ' + money(offer.renewalUsd) + ' yearly renewal · '
|
|
57
|
+
+ money(offer.threeYearUsd) + ' over three years' + term
|
|
58
|
+
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function checkLines(check, pending) {
|
|
62
|
+
const { domains, choice, nameChecks, score } = check;
|
|
63
|
+
const pick = choice?.pick;
|
|
64
|
+
const taken = domains.filter(row => row.status === 'taken').map(row => row.domain);
|
|
65
|
+
const unknown = domains.filter(row => row.status === 'unknown');
|
|
66
|
+
return [
|
|
67
|
+
...(score?.filtered ? [md(check.query.name) + ' · ' + md(score.filtered)]
|
|
68
|
+
: Number.isInteger(score?.value) ? [md(check.query.name) + ' · Name score ' + score.value + '/100 · ' + md(score.band),
|
|
69
|
+
...(score.reasons ?? []).map(md)] : []),
|
|
70
|
+
...(pick ? ['The Hound’s pick is ' + md(pick.domain) + ' at ' + md(pick.shop) + ' for ' + money(pick.threeYearUsd) + ' over three years.'] : []),
|
|
71
|
+
...domains.filter(row => row.status === 'available').flatMap(row => [
|
|
72
|
+
'Available · ' + md(row.domain),
|
|
73
|
+
...(row.prices?.length ? row.prices.map((offer, index) => priceLine(offer, index === 0)) : ['Check the price at the shop.']),
|
|
74
|
+
]),
|
|
75
|
+
...nameCheckLines(nameChecks, pending, check.query.name),
|
|
76
|
+
...(taken.length ? ['Taken · ' + taken.map(md).join(', ') + '. '
|
|
77
|
+
+ link('Watch', 'https://domainhound.dev/watch/?domain=' + encodeURIComponent(taken[0]))
|
|
78
|
+
+ ' · Draft an offer · Try a new name'] : []),
|
|
79
|
+
...(unknown.length ? ['Could not confirm ' + (domains.length === 1 ? md(unknown[0].domain)
|
|
80
|
+
: unknown.length + (unknown.length === 1 ? ' ending' : ' endings')) + '.'] : []),
|
|
81
|
+
];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function preferredPick(check, args) {
|
|
85
|
+
if (!args.endings?.length && args.budget == null && !args.eligible?.length && !args.country) return check.choice.pick;
|
|
86
|
+
if (check.query.exactDomain) return check.choice.pick;
|
|
87
|
+
const options = check.domains.filter(row => row.status === 'available' && canRecommend(row.ending, args.eligible)
|
|
88
|
+
&& (!args.endings?.length || args.endings.includes(row.ending))).flatMap(row =>
|
|
89
|
+
row.prices.filter(offer => args.budget == null || offer.firstPaymentUsd <= args.budget).map(offer => ({
|
|
90
|
+
...offer, domain: row.domain, now: offer.firstPaymentUsd, total: offer.threeYearUsd,
|
|
91
|
+
})));
|
|
92
|
+
return choosePick(options, { requested: args.endings, eligible: args.eligible, budget: args.budget }) ?? null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function hostedChecks(checks, args, triage = false) {
|
|
96
|
+
const classes = relevantClasses(args.category);
|
|
97
|
+
const candidates = new Map(Object.entries(args.candidates ?? {}).map(([name, value]) => [normalizeName(name), value]));
|
|
98
|
+
return checks.map(check => {
|
|
99
|
+
const pick = preferredPick(check, args);
|
|
100
|
+
if (!triage) return pick === check.choice.pick ? check : { ...check, choice: { ...check.choice, pick } };
|
|
101
|
+
const us = check.nameChecks?.trademarks?.us;
|
|
102
|
+
const score = scoreName({
|
|
103
|
+
name: check.query.name,
|
|
104
|
+
candidate: candidates.get(normalizeName(check.query.name)),
|
|
105
|
+
domains: check.domains.filter(row => row.status === 'available' && canRecommend(row.ending, args.eligible)
|
|
106
|
+
&& (!args.endings?.length || args.endings.includes(row.ending)))
|
|
107
|
+
.map(row => ({ ending: row.ending, total: row.prices[0]?.threeYearUsd, registry: true })),
|
|
108
|
+
marks: { us: us?.status && us.status !== 'unknown' ? 'ok' : 'unknown',
|
|
109
|
+
list: us?.marks.map(mark => ({ tier: 'Exact', live: true,
|
|
110
|
+
sameClass: mark.classes?.length ? mark.classes.some(value => classes.includes(value)) : null })) },
|
|
111
|
+
apps: { list: check.nameChecks?.appStore?.matches },
|
|
112
|
+
handles: scoreHandles(check.nameChecks?.handles),
|
|
113
|
+
});
|
|
114
|
+
return { ...check, score, choice: { ...check.choice, pick: scoreEligible({ score }) ? pick : null } };
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function generatedChecks(generation) {
|
|
119
|
+
return generation.names.map(entry => ({
|
|
120
|
+
query: { name: entry.name, exactDomain: null },
|
|
121
|
+
domains: entry.domains,
|
|
122
|
+
choice: { pick: entry.domain },
|
|
123
|
+
nameChecks: entry.nameChecks,
|
|
124
|
+
score: { ...entry.score, value: entry.score?.total },
|
|
125
|
+
share: entry.share,
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function hostedResult(checks, args, generation, { pending = false, failed = false, checkedAt } = {}) {
|
|
130
|
+
const shown = !generation && args.shortlist && checks.some(check => check.score)
|
|
131
|
+
? checks.filter(check => scoreEligible(check)).sort((a, b) => compareScores(a.score, b.score)).slice(0, 8) : checks;
|
|
132
|
+
const lines = [
|
|
133
|
+
...checks.flatMap(warning),
|
|
134
|
+
...(shown.length ? shown.flatMap((check, index) => [
|
|
135
|
+
...(shown.length > 1 ? [md(check.query.exactDomain ?? check.query.name)] : []),
|
|
136
|
+
...checkLines(check, pending),
|
|
137
|
+
...(index < shown.length - 1 ? [''] : []),
|
|
138
|
+
]) : [pending ? 'Still checking names and domains.' : 'No names passed the checks.']),
|
|
139
|
+
...(pending ? ['The results page updates when the remaining checks finish.'] : []),
|
|
140
|
+
...(failed ? ['The remaining checks did not finish.'] : []),
|
|
141
|
+
...(generation?.question && !pending ? [md(generation.question)] : []),
|
|
142
|
+
...((generation?.priceSnapshot ?? checks[0]?.priceSnapshot)?.checkedAt
|
|
143
|
+
? ['Dated list prices in USD before tax · ' + md((generation?.priceSnapshot ?? checks[0].priceSnapshot).checkedAt.slice(0, 10))] : []),
|
|
144
|
+
];
|
|
145
|
+
const names = checks.map(check => {
|
|
146
|
+
const rows = status => check.domains.filter(row => row.status === status);
|
|
147
|
+
return { name: check.query.exactDomain ?? check.query.name,
|
|
148
|
+
available: rows('available').map(row => row.ending), free: rows('available').map(row => ({ d: row.ending })),
|
|
149
|
+
taken: rows('taken').map(row => row.ending), shop_check: rows('unknown').map(row => row.ending),
|
|
150
|
+
...(check.score && { score: check.score }) };
|
|
151
|
+
});
|
|
152
|
+
const { details, ...generationResult } = generation ?? {};
|
|
153
|
+
return { hosted: true, checks, names, ...(generation && { generation: generationResult }), ...(pending && { pending: true }),
|
|
154
|
+
complete: generation ? !pending && !failed && generation.complete : checks.every(check => check.complete),
|
|
155
|
+
checkedAt: checkedAt ?? generation?.checkedAt ?? checks[0]?.checkedAt ?? new Date().toISOString(),
|
|
156
|
+
lines: attributed(lines.join('\n'), Boolean(args.purchase || (checks.length === 1 && checks[0].query.exactDomain))).split('\n') };
|
|
157
|
+
}
|
package/hosted.mjs
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { setTimeout as wait } from 'node:timers/promises';
|
|
2
|
+
import { checkGooglePlayNames, checkSocialHandles, embedChecksEnabled, handleLabel, handleStates, publicProfiles } from './clis/domain-check/handles.mjs';
|
|
3
|
+
import { googlePlayLabel, googlePlayLinkLabel, playSearchLink } from './clis/domain-check/google-play.mjs';
|
|
4
|
+
import { normalizeName } from './clis/domain-check/name-search.mjs';
|
|
5
|
+
import { searchApps } from './clis/domain-check/triage-sources.mjs';
|
|
6
|
+
|
|
7
|
+
export const hostedBase = 'https://domainhound-mcp.domainhound.workers.dev';
|
|
8
|
+
export class HostedRateLimit extends Error {}
|
|
9
|
+
|
|
10
|
+
const validCheck = body => body?.version === 1 && typeof body.query?.ascii === 'string' &&
|
|
11
|
+
Array.isArray(body.domains) && body.domains.every(row => typeof row.domain === 'string' &&
|
|
12
|
+
['available', 'taken', 'unknown'].includes(row.status) && Array.isArray(row.prices)) && body.choice;
|
|
13
|
+
const validDetails = body => body?.version === 1 && body.appStore && body.googlePlay &&
|
|
14
|
+
Array.isArray(body.trademarks?.us?.marks) && Array.isArray(body.handles);
|
|
15
|
+
const validGeneration = body => body?.version === 2 && ['initial', 'final'].includes(body.stage) && Array.isArray(body.names);
|
|
16
|
+
|
|
17
|
+
export function hostedClient(version, { env = process.env, fetchFn = fetch, apple = searchApps } = {}) {
|
|
18
|
+
if (env.DOMAIN_HOUND_LOCAL === '1') return null;
|
|
19
|
+
let base;
|
|
20
|
+
try {
|
|
21
|
+
base = new URL(env.DOMAIN_HOUND_API_URL || hostedBase);
|
|
22
|
+
const loopback = ['localhost', '127.0.0.1', '[::1]'].includes(base.hostname);
|
|
23
|
+
if (base.username || base.password || (base.protocol !== 'https:' && !(loopback && base.protocol === 'http:'))) return null;
|
|
24
|
+
} catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function read(path, { body, params, timeout, signal } = {}) {
|
|
29
|
+
const url = new URL(path, base);
|
|
30
|
+
if (params) url.search = new URLSearchParams(params).toString();
|
|
31
|
+
const res = await fetchFn(url, {
|
|
32
|
+
redirect: 'error',
|
|
33
|
+
headers: { 'X-Domain-Hound-Client': 'mcp/' + version, ...(body && { 'Content-Type': 'application/json' }) },
|
|
34
|
+
...(body && { method: 'POST', body: JSON.stringify(body) }),
|
|
35
|
+
signal: signal ? AbortSignal.any([signal, AbortSignal.timeout(timeout)]) : AbortSignal.timeout(timeout),
|
|
36
|
+
});
|
|
37
|
+
if (!res.ok) {
|
|
38
|
+
await res.body?.cancel().catch(() => {});
|
|
39
|
+
if (res.status === 429) throw new HostedRateLimit();
|
|
40
|
+
throw new Error('Hosted check unavailable');
|
|
41
|
+
}
|
|
42
|
+
return res.json();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const get = async (name, signal) => {
|
|
46
|
+
const body = await read('/v1/check', { params: { name }, timeout: 5600, signal });
|
|
47
|
+
if (!validCheck(body)) throw new Error('Invalid hosted check');
|
|
48
|
+
return body;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
async function recoverApple(app, name, signal) {
|
|
52
|
+
if (app?.status !== 'unknown' || app.reason !== 'rate-limited') return app;
|
|
53
|
+
const label = normalizeName(name);
|
|
54
|
+
if (!label) return app;
|
|
55
|
+
const checked = await apple(label, name, { signal: AbortSignal.any([signal, AbortSignal.timeout(2800)]), fetcher: fetchFn })
|
|
56
|
+
.catch(() => null);
|
|
57
|
+
if (!Array.isArray(checked)) return app;
|
|
58
|
+
return { ...app, status: checked.length ? 'taken' : 'no_match_found', reason: null,
|
|
59
|
+
matches: checked.map(({ name, url }) => ({ name, url })), checkedAt: new Date().toISOString(), source: 'local' };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function recoverNameChecks(entries, signal) {
|
|
63
|
+
const enabled = embedChecksEnabled(env);
|
|
64
|
+
const definite = value => ['taken', 'not-found', 'not-seen'].includes(value);
|
|
65
|
+
const checked = entries.filter(entry => Array.isArray(entry.nameChecks?.handles));
|
|
66
|
+
const instagramAnswers = new Map(checked.flatMap(({ name, nameChecks }) => {
|
|
67
|
+
const instagram = nameChecks.handles.find(row => row.platform === 'Instagram');
|
|
68
|
+
return definite(instagram?.state) ? [[instagram.handle ?? normalizeName(name), instagram]] : [];
|
|
69
|
+
}));
|
|
70
|
+
const profiles = checked.flatMap(({ name, nameChecks }) => Object.keys(publicProfiles).flatMap(platform => {
|
|
71
|
+
const row = nameChecks.handles.find(row => row.platform === platform);
|
|
72
|
+
const oldThreadsMissing = platform === 'Threads' && row?.state === 'not-found' && row.why !== 'no Instagram account';
|
|
73
|
+
if ((enabled || platform === 'YouTube') && definite(row?.state) && !oldThreadsMissing) return [];
|
|
74
|
+
const handle = row?.handle ?? normalizeName(name);
|
|
75
|
+
return handle ? [{ platform, handle, row, nameChecks }] : [];
|
|
76
|
+
}));
|
|
77
|
+
const wanted = new Map();
|
|
78
|
+
for (const { handle, platform } of profiles) {
|
|
79
|
+
if (!wanted.has(handle)) wanted.set(handle, new Set());
|
|
80
|
+
wanted.get(handle).add(platform);
|
|
81
|
+
}
|
|
82
|
+
const rows = [...wanted].map(([name, platforms]) => ({ name, platforms: [...platforms], links: false }));
|
|
83
|
+
const play = checked.filter(({ nameChecks }) => !enabled || !definite(nameChecks.googlePlay?.status));
|
|
84
|
+
const options = { fetcher: fetchFn, env, signal };
|
|
85
|
+
const [handles, playResults] = await Promise.all([
|
|
86
|
+
checkSocialHandles(rows, { ...options, instagramAnswers, extraPlatforms: ['Reddit', 'Twitch'] }).catch(() => null),
|
|
87
|
+
checkGooglePlayNames(play.map(({ name }) => name), options).catch(() => null),
|
|
88
|
+
]);
|
|
89
|
+
for (const { platform, handle, row, nameChecks } of profiles) {
|
|
90
|
+
const result = handles?.get(handle)?.find(result => result.platform === platform);
|
|
91
|
+
if (!result) continue;
|
|
92
|
+
const { linkLabel, seenYear, source, ...prior } = row ?? {};
|
|
93
|
+
const profile = { ...prior, ...result, label: handleLabel(result), checkedAt: result.checkedAt ?? null,
|
|
94
|
+
why: result.why ?? null, ...(definite(result.state) && { source: 'local' }) };
|
|
95
|
+
nameChecks.handles = row ? nameChecks.handles.map(entry => entry === row ? profile : entry)
|
|
96
|
+
: [...nameChecks.handles, profile];
|
|
97
|
+
}
|
|
98
|
+
for (const { name, nameChecks } of play) {
|
|
99
|
+
const result = playResults?.get(name);
|
|
100
|
+
const status = result?.state ?? 'unknown';
|
|
101
|
+
nameChecks.googlePlay = {
|
|
102
|
+
...nameChecks.googlePlay, status, checkedAt: result?.checkedAt ?? null,
|
|
103
|
+
label: enabled ? handleStates[status] : googlePlayLabel,
|
|
104
|
+
link: nameChecks.googlePlay?.link ?? playSearchLink(name), linkLabel: googlePlayLinkLabel,
|
|
105
|
+
why: enabled ? result?.why ?? (status === 'unknown' ? 'no clear answer in time' : null) : 'no public search',
|
|
106
|
+
...(definite(status) && { source: 'local' }),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return {
|
|
112
|
+
async check(name, extraEndings, signal) {
|
|
113
|
+
const [main, ...extras] = await Promise.all([get(name, signal),
|
|
114
|
+
...extraEndings.map(ending => get(normalizeName(name) + '.' + ending, signal))]);
|
|
115
|
+
let nameChecks = null;
|
|
116
|
+
if (typeof main.details?.id === 'string') {
|
|
117
|
+
nameChecks = await read('/v1/check/details', {
|
|
118
|
+
params: { id: main.details.id }, timeout: 6600, signal,
|
|
119
|
+
}).then(body => validDetails(body) ? body : null, () => null);
|
|
120
|
+
}
|
|
121
|
+
if (nameChecks) {
|
|
122
|
+
await Promise.all([
|
|
123
|
+
recoverApple(nameChecks.appStore, main.query.name, signal).then(app => { nameChecks.appStore = app; }),
|
|
124
|
+
recoverNameChecks([{ name: main.query.name, nameChecks }], signal),
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
const { details, ...answer } = main;
|
|
128
|
+
return { ...answer, domains: [...main.domains, ...extras.flatMap(extra => extra.domains)], nameChecks,
|
|
129
|
+
complete: main.complete && extras.every(extra => extra.complete) };
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
async generate(args, signal) {
|
|
133
|
+
const generation = await read('/v1/generate', { body: args, timeout: 9400, signal });
|
|
134
|
+
if (!validGeneration(generation)) throw new Error('Invalid hosted generation');
|
|
135
|
+
if (generation.stage === 'final') await recoverNameChecks(generation.names, signal);
|
|
136
|
+
return generation;
|
|
137
|
+
},
|
|
138
|
+
|
|
139
|
+
async finishGeneration(initial) {
|
|
140
|
+
const { id, pollAfterMs } = initial.details;
|
|
141
|
+
const signal = AbortSignal.timeout(34_000);
|
|
142
|
+
let delay = pollAfterMs;
|
|
143
|
+
while (!signal.aborted) {
|
|
144
|
+
await wait(Math.max(500, Math.min(3000, Number(delay) || 1500)), undefined, { signal });
|
|
145
|
+
const body = await read('/v1/generate/details', { body: { id }, timeout: 4500, signal });
|
|
146
|
+
if (body?.stage === 'pending') {
|
|
147
|
+
delay = body.retryAfterMs;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (!validGeneration(body) || body.stage !== 'final') throw new Error('Invalid hosted generation details');
|
|
151
|
+
await Promise.all([
|
|
152
|
+
recoverNameChecks(body.names, signal),
|
|
153
|
+
...body.names.map(async entry => {
|
|
154
|
+
const app = await recoverApple(entry.nameChecks?.appStore ?? entry.appStore, entry.name, signal);
|
|
155
|
+
if (entry.nameChecks) entry.nameChecks.appStore = app;
|
|
156
|
+
if (app) entry.appStore = app;
|
|
157
|
+
}),
|
|
158
|
+
]);
|
|
159
|
+
return body;
|
|
160
|
+
}
|
|
161
|
+
throw new Error('Hosted generation expired');
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domain-hound",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,8 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"bin/domain-hound.mjs",
|
|
42
42
|
"server.mjs",
|
|
43
|
+
"hosted.mjs",
|
|
44
|
+
"hosted-results.mjs",
|
|
43
45
|
"display.mjs",
|
|
44
46
|
"results.mjs",
|
|
45
47
|
"results-style.mjs",
|
|
@@ -56,9 +58,13 @@
|
|
|
56
58
|
"clis/domain-check/google-play.mjs",
|
|
57
59
|
"clis/domain-check/google-search.mjs",
|
|
58
60
|
"clis/domain-check/handles.mjs",
|
|
61
|
+
"clis/domain-check/public-name-checks.mjs",
|
|
62
|
+
"clis/domain-check/youtube-handle.mjs",
|
|
59
63
|
"clis/domain-check/index.mjs",
|
|
60
64
|
"clis/domain-check/marketplaces.mjs",
|
|
61
65
|
"clis/domain-check/name-search.mjs",
|
|
66
|
+
"clis/domain-check/name-score.mjs",
|
|
67
|
+
"clis/domain-check/score-log.mjs",
|
|
62
68
|
"clis/domain-check/naming-method.mjs",
|
|
63
69
|
"clis/domain-check/parking.mjs",
|
|
64
70
|
"clis/domain-check/price-catalog.mjs",
|
|
@@ -91,6 +97,7 @@
|
|
|
91
97
|
"clis/portfolio/store.mjs",
|
|
92
98
|
"clis/portfolio/transfer-prices.mjs",
|
|
93
99
|
"assets/",
|
|
100
|
+
"skills/naming/SKILL.md",
|
|
94
101
|
".claude-plugin/plugin.json",
|
|
95
102
|
".claude-plugin/marketplace.json",
|
|
96
103
|
".agents/plugins/marketplace.json",
|
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
|
+
"version": "0.1.9",
|
|
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/results-style.mjs
CHANGED
|
@@ -57,6 +57,9 @@ thead th:nth-child(n+2), tbody td { text-align: right; }
|
|
|
57
57
|
tbody td { font-variant-numeric: lining-nums tabular-nums; }
|
|
58
58
|
th[scope="row"] code { display: block; font-weight: 800; }
|
|
59
59
|
th[scope="row"] small { display: block; font: 400 .9375rem/1.45 system-ui, sans-serif; }
|
|
60
|
+
.name-score { margin-block: .5rem; padding: .5rem .8rem; border: 2px solid var(--blue); background: var(--gold); }
|
|
61
|
+
.name-score p { margin: 0; font-weight: 800; }
|
|
62
|
+
.name-score ul { margin: .35rem 0 0; padding-left: 1.1rem; }
|
|
60
63
|
details { border-bottom: 1px dashed var(--blue); }
|
|
61
64
|
summary { cursor: pointer; font-weight: 750; }
|
|
62
65
|
details[open] { padding-bottom: .65rem; }
|