domain-hound 0.1.10 → 0.1.12
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 +3 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +24 -7
- package/assets/mulish-OFL.txt +93 -0
- package/assets/mulish-latin-wght-normal.woff2 +0 -0
- package/assets/results.css +176 -0
- package/clis/domain-check/handles.mjs +2 -2
- package/clis/domain-check/price-catalog.mjs +1 -1
- package/clis/domain-check/registry.mjs +6 -4
- package/clis/domain-check/traction.mjs +1 -1
- package/clis/portfolio/page.mjs +1 -14
- package/clis/portfolio/portfolio.mjs +5 -5
- package/clis/spaceship/tools.mjs +36 -42
- package/dossier.mjs +5 -5
- package/hosted-results.mjs +93 -47
- package/hosted.mjs +70 -7
- package/package.json +3 -1
- package/plugin.json +2 -1
- package/results-cards.mjs +175 -0
- package/results-style.mjs +9 -0
- package/results.mjs +134 -117
- package/server.json +2 -2
- package/server.mjs +195 -60
- package/skills/domains/SKILL.md +13 -0
- package/skills/naming/SKILL.md +1 -1
- package/watch.mjs +4 -4
package/clis/spaceship/tools.mjs
CHANGED
|
@@ -14,18 +14,19 @@ const domainField = { type: 'string', minLength: 3, maxLength: 253, description:
|
|
|
14
14
|
|
|
15
15
|
export const quoteTool = {
|
|
16
16
|
name: 'quote_domain',
|
|
17
|
-
description: '
|
|
18
|
-
+ '
|
|
19
|
-
annotations: { title: 'Quote a domain at Spaceship', readOnlyHint:
|
|
17
|
+
description: 'Use this when the person wants a live Spaceship purchase quote for an exact available domain. '
|
|
18
|
+
+ 'Shows the term, upfront payment, renewal and premium status, and saves a short-lived quote locally. Use check_domains for list prices and buy_domain for checkout.',
|
|
19
|
+
annotations: { title: 'Quote a domain at Spaceship', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
20
20
|
inputSchema: { type: 'object', properties: {
|
|
21
21
|
domain: domainField,
|
|
22
|
-
years: { type: 'integer', minimum: 1, maximum: 10, description: '
|
|
22
|
+
years: { type: 'integer', minimum: 1, maximum: 10, description: 'Term in years, e.g. 2. Omit for the shortest available term.' },
|
|
23
23
|
}, required: ['domain'], additionalProperties: false },
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export const buyTool = {
|
|
27
27
|
name: 'buy_domain',
|
|
28
|
-
description: '
|
|
28
|
+
description: 'Use this when the person wants to buy a domain after getting a live Spaceship quote. COSTS MONEY. '
|
|
29
|
+
+ 'Use quote_domain for pricing alone. Requires an unexpired quote_id and agreed max_usd. Stop on any price change or above either limit. '
|
|
29
30
|
+ 'Preview with Spaceship’s ' + spaceshipMcp.tool + ' by default. Check the quote and limits, stop if price or payment method is missing, '
|
|
30
31
|
+ 'and accept the full confirmation only after showing it and getting approval. Direct orders need opt-in, a standard-price minimum term '
|
|
31
32
|
+ 'and approved confirm: true. Spaceship sets the charge. Checkout requires a valid quote and no submitted order. '
|
|
@@ -33,40 +34,46 @@ export const buyTool = {
|
|
|
33
34
|
annotations: { title: 'Buy a domain (costs money)', readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
34
35
|
inputSchema: { type: 'object', properties: {
|
|
35
36
|
domain: domainField,
|
|
36
|
-
quote_id: { type: 'string', maxLength: 40, description: '
|
|
37
|
-
max_usd: { type: 'number', exclusiveMinimum: 0, maximum: 100000, description: '
|
|
38
|
-
confirm: { type: 'boolean', description: '
|
|
37
|
+
quote_id: { type: 'string', maxLength: 40, description: 'Quote ID returned by quote_domain, e.g. "example-quote-id".' },
|
|
38
|
+
max_usd: { type: 'number', exclusiveMinimum: 0, maximum: 100000, description: 'Approved upfront limit in USD, e.g. 25.' },
|
|
39
|
+
confirm: { type: 'boolean', description: 'Set true only after the person approves the exact quote. Omit for a dry run.' },
|
|
39
40
|
}, required: ['domain', 'quote_id', 'max_usd'], additionalProperties: false },
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
const hostField = description => ({ type: 'string', maxLength: 253, description });
|
|
43
44
|
export const setupTool = {
|
|
44
45
|
name: 'setup_domain',
|
|
45
|
-
description: '
|
|
46
|
+
description: 'Use this when pointing an owned Spaceship domain to a website or mail provider, or verifying a purchase. CHANGES DNS when applied. '
|
|
47
|
+
+ 'Use buy_domain for buying. Preview without plan_id, then apply with plan_id and apply: true after approval. '
|
|
46
48
|
+ 'Record removal also needs replace: true. Use provider-supplied values. '
|
|
47
49
|
+ 'With only verify: true it writes nothing: it looks the domain up at the registry and in the Spaceship account. '
|
|
48
50
|
+ 'Verify after a purchase and before DNS setup. Relay the display as written.',
|
|
49
51
|
annotations: { title: 'Set up domain DNS (changes DNS)', readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: true },
|
|
50
52
|
inputSchema: { type: 'object', properties: {
|
|
51
53
|
domain: domainField,
|
|
52
|
-
website: { type: 'object', additionalProperties: false, required: ['provider'],
|
|
53
|
-
|
|
54
|
+
website: { type: 'object', additionalProperties: false, required: ['provider'],
|
|
55
|
+
description: 'Website settings, e.g. {"provider":"cname","target":"www.example.net"}.', properties: {
|
|
56
|
+
provider: { type: 'string', enum: websiteProviders, description: 'Website provider, e.g. "vercel".' },
|
|
54
57
|
target: hostField('GitHub Pages user.github.io, Netlify site.netlify.app, Cloudflare Pages project.pages.dev, or a CNAME target.'),
|
|
55
|
-
ipv4: { type: 'array', maxItems: 8, items: { type: 'string', maxLength: 15 }, description: '
|
|
56
|
-
ipv6: { type: 'array', maxItems: 8, items: { type: 'string', maxLength: 45 }, description: '
|
|
57
|
-
www_target: hostField('Vercel
|
|
58
|
+
ipv4: { type: 'array', maxItems: 8, items: { type: 'string', maxLength: 15 }, description: 'IPv4 targets for ip or Vercel, e.g. ["192.0.2.10"].' },
|
|
59
|
+
ipv6: { type: 'array', maxItems: 8, items: { type: 'string', maxLength: 45 }, description: 'IPv6 targets for ip only, e.g. ["2001:db8::10"].' },
|
|
60
|
+
www_target: hostField('Vercel www CNAME from the project’s Domains page, e.g. "www.example.net".'),
|
|
58
61
|
} },
|
|
59
|
-
mail: { type: 'object', additionalProperties: false, required: ['provider'],
|
|
60
|
-
|
|
62
|
+
mail: { type: 'object', additionalProperties: false, required: ['provider'],
|
|
63
|
+
description: 'Mail settings, e.g. {"provider":"google-workspace"}.', properties: {
|
|
64
|
+
provider: { type: 'string', enum: mailProviders, description: 'Mail provider, e.g. "google-workspace".' },
|
|
61
65
|
mx: { type: 'array', minItems: 1, maxItems: 5, items: { type: 'object', additionalProperties: false, required: ['exchange', 'preference'],
|
|
62
|
-
properties: { exchange: { type: 'string', maxLength: 253
|
|
63
|
-
|
|
66
|
+
properties: { exchange: { type: 'string', maxLength: 253, description: 'Mail server, e.g. "mx.example.net".' },
|
|
67
|
+
preference: { type: 'integer', minimum: 0, maximum: 65535, description: 'MX priority, e.g. 10.' } } },
|
|
68
|
+
description: 'Provider MX, e.g. [{"exchange":"mx.example.net","preference":10}]. Required for microsoft-365 and forward-only. Optional for icloud.' },
|
|
64
69
|
records: { type: 'array', maxItems: 10, items: { type: 'object', additionalProperties: false, required: ['type', 'name', 'value'],
|
|
65
|
-
properties: { type: { type: 'string', enum: ['TXT', 'CNAME']
|
|
66
|
-
|
|
67
|
-
|
|
70
|
+
properties: { type: { type: 'string', enum: ['TXT', 'CNAME'], description: 'Record type, e.g. "TXT".' },
|
|
71
|
+
name: { type: 'string', maxLength: 190, description: 'Record name, e.g. "@".' },
|
|
72
|
+
value: { type: 'string', maxLength: 2048, description: 'Record value, e.g. "verify-example".' } } },
|
|
73
|
+
description: 'Provider-supplied verification and DKIM records, e.g. [{"type":"TXT","name":"@","value":"verify-example"}]. Never guess.' },
|
|
74
|
+
dmarc: { type: 'string', enum: ['none', 'quarantine', 'reject'], description: 'User-selected DMARC policy, e.g. "quarantine". Omit to keep an existing valid policy.' },
|
|
68
75
|
} },
|
|
69
|
-
plan_id: { type: 'string', maxLength: 40, description: '
|
|
76
|
+
plan_id: { type: 'string', maxLength: 40, description: 'Plan ID from the preview, e.g. "example-plan-id".' },
|
|
70
77
|
apply: { type: 'boolean', description: 'True only with plan_id, after the person approved the previewed changes.' },
|
|
71
78
|
replace: { type: 'boolean', description: 'True only when the person agreed to remove the existing records the plan lists.' },
|
|
72
79
|
verify: { type: 'boolean', description: 'True, alone with domain, to check a purchase at the registry and in the person’s account. Writes nothing.' },
|
|
@@ -75,7 +82,8 @@ export const setupTool = {
|
|
|
75
82
|
|
|
76
83
|
export const moveTool = {
|
|
77
84
|
name: 'move_domain',
|
|
78
|
-
description: '
|
|
85
|
+
description: 'Use this when transferring an owned domain to another registrar or checking a transfer’s progress. '
|
|
86
|
+
+ 'For a new registration use check_domains. Compare three-year costs, check locks and expiry, and get registrar steps. '
|
|
79
87
|
+ 'A Spaceship key adds a 10-minute quote. COSTS MONEY with quote_id and max_usd: rechecks the quote and opens a path to checkout. '
|
|
80
88
|
+ 'Direct transfer requires server opt-in, approval, confirm: true and the private auth_code. Keep the code private and never retry an unclear transfer. '
|
|
81
89
|
+ 'Use status: true to follow a transfer. Relay the display as written.',
|
|
@@ -83,11 +91,11 @@ export const moveTool = {
|
|
|
83
91
|
openWorldHint: true },
|
|
84
92
|
inputSchema: { type: 'object', properties: {
|
|
85
93
|
domain: domainField,
|
|
86
|
-
quote_id: { type: 'string', maxLength: 40, description: '
|
|
87
|
-
max_usd: { type: 'number', exclusiveMinimum: 0, maximum: 100000, description: '
|
|
88
|
-
confirm: { type: 'boolean', description: '
|
|
94
|
+
quote_id: { type: 'string', maxLength: 40, description: 'Transfer quote ID from the plan, e.g. "example-transfer-id".' },
|
|
95
|
+
max_usd: { type: 'number', exclusiveMinimum: 0, maximum: 100000, description: 'Approved transfer limit in USD, e.g. 25.' },
|
|
96
|
+
confirm: { type: 'boolean', description: 'Set true for a direct transfer only after approval of the dry run.' },
|
|
89
97
|
auth_code: { type: 'string', minLength: 1, maxLength: 50, description: 'Direct transfers only, with confirm: true. Pass the code from '
|
|
90
|
-
+ 'the person’s private input. Keep it out of chat, logs and results.' },
|
|
98
|
+
+ 'the person’s private input (for example, a registrar-issued transfer code). Keep it out of chat, logs and results.' },
|
|
91
99
|
status: { type: 'boolean', description: 'True, alone with domain, to follow a transfer into the person’s Spaceship account.' },
|
|
92
100
|
}, required: ['domain'], additionalProperties: false },
|
|
93
101
|
};
|
|
@@ -95,22 +103,8 @@ export const moveTool = {
|
|
|
95
103
|
export const purchaseTools = [quoteTool, buyTool, setupTool, moveTool];
|
|
96
104
|
export const purchaseToolNames = new Set(purchaseTools.map(tool => tool.name));
|
|
97
105
|
|
|
98
|
-
// Replace stale global claims in the check tools with the handoff, whatever the rest of their wording says.
|
|
99
|
-
const handoffSentence = 'To buy through the person’s own Spaceship account, use quote_domain, then buy_domain.';
|
|
100
|
-
export function currentDescription(text, handoff = true) {
|
|
101
|
-
const updated = String(text)
|
|
102
|
-
.replace(/Domain Hound cannot buy or complete checkout/g, 'This check leaves checkout to you')
|
|
103
|
-
.replace(/\bNever buys\./g, 'This check leaves checkout to you.')
|
|
104
|
-
.replace(/Domain Hound never buys/gi, 'This check leaves checkout to you')
|
|
105
|
-
.replace(/\b(?:cannot|can't|never) buys?\b/gi, 'leaves checkout to you');
|
|
106
|
-
return !handoff || updated.includes(handoffSentence) ? updated : updated.trimEnd() + ' ' + handoffSentence;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// The legacy alias stays short, so only check_domains carries the handoff sentence.
|
|
110
106
|
export function registeredTools(tools) {
|
|
111
|
-
|
|
112
|
-
? { ...tool, description: currentDescription(tool.description, tool.name === 'check_domains') } : tool);
|
|
113
|
-
return [...updated, ...purchaseTools.filter(tool => !updated.some(other => other.name === tool.name))];
|
|
107
|
+
return [...tools, ...purchaseTools.filter(tool => !tools.some(other => other.name === tool.name))];
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
// One line that offers the exact quote when a checked or watched domain is free.
|
package/dossier.mjs
CHANGED
|
@@ -4,16 +4,16 @@ import { dnsNeed } from './clis/domain-check/prices.mjs';
|
|
|
4
4
|
|
|
5
5
|
export const dossierTool = {
|
|
6
6
|
name: 'taken_domain_dossier',
|
|
7
|
-
description: '
|
|
8
|
-
+ '
|
|
9
|
-
+ '
|
|
10
|
-
annotations: { title: 'Taken domain dossier', readOnlyHint: true, destructiveHint: false, openWorldHint: true },
|
|
7
|
+
description: 'Use this when investigating a taken domain’s ownership, sale listing or likely price range. Checks registry and public site evidence, '
|
|
8
|
+
+ 'and finds up to three available alternatives with upfront, renewal and three-year prices and a quick trademark, app and rival screen. '
|
|
9
|
+
+ 'For release alerts use watch_domain. Keep maxBudget private and never send an offer draft.',
|
|
10
|
+
annotations: { title: 'Taken domain dossier', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true },
|
|
11
11
|
inputSchema: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
14
|
domain: { type: 'string', minLength: 3, maxLength: 127, description: 'The exact taken domain, like example.com.' },
|
|
15
15
|
maxBudget: { type: 'number', minimum: 0,
|
|
16
|
-
description: 'Optional private walk-away price in USD. Kept out of every draft and the display.' },
|
|
16
|
+
description: 'Optional private walk-away price in USD, e.g. 250. Kept out of every draft and the display.' },
|
|
17
17
|
},
|
|
18
18
|
required: ['domain'],
|
|
19
19
|
additionalProperties: false,
|
package/hosted-results.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { attributed, md } from './display.mjs';
|
|
|
2
2
|
import { canRecommend, choosePick, normalizeName } from './clis/domain-check/name-search.mjs';
|
|
3
3
|
import { compareScores, scoreEligible, scoreHandles, scoreName } from './clis/domain-check/name-score.mjs';
|
|
4
4
|
import { relevantClasses } from './clis/domain-check/triage-sources.mjs';
|
|
5
|
-
import { handleLabel
|
|
6
|
-
import {
|
|
5
|
+
import { handleLabel } from './clis/domain-check/handles.mjs';
|
|
6
|
+
import { googlePlayLinkLabel, playSearchLink } from './clis/domain-check/google-play.mjs';
|
|
7
7
|
|
|
8
8
|
const money = value => Number.isFinite(value) ? '$' + value.toFixed(2) : 'price at shop';
|
|
9
9
|
const platforms = ['LinkedIn', 'X', 'Instagram', 'TikTok', 'YouTube', 'Threads', 'Facebook', 'Reddit', 'Twitch', 'GitHub'];
|
|
@@ -18,36 +18,69 @@ function link(label, value) {
|
|
|
18
18
|
return md(label);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
export const usTrademark = check => check.trademarks?.us ?? check.nameChecks?.trademarks?.us;
|
|
22
|
+
|
|
23
|
+
const usptoSearch = 'https://tmsearch.uspto.gov/';
|
|
24
|
+
|
|
25
|
+
function usptoLink(label, value) {
|
|
26
|
+
try {
|
|
27
|
+
const url = new URL(value);
|
|
28
|
+
if (url.origin === 'https://tsdr.uspto.gov' && !url.username && !url.password) return link(label, url.href);
|
|
29
|
+
} catch { /* The trademark search is available when the filing link is missing. */ }
|
|
30
|
+
return link(label, usptoSearch);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function trademarkLines(check, pending, markLimit = 10) {
|
|
34
|
+
const us = usTrademark(check);
|
|
35
|
+
if (us?.status === 'pending' || (!us && pending)) return ['Trademark check still running.'];
|
|
36
|
+
if (us?.status === 'no_exact_match_found') return ['US trademark: no exact live match found.'];
|
|
37
|
+
if (us?.status !== 'exact_match_found') return ['US trademark: couldn’t check. ' + link('Search US trademarks', usptoSearch)];
|
|
38
|
+
const marks = us.marks?.length ? us.marks.slice(0, markLimit) : [{ mark: check.query.name }];
|
|
39
|
+
return [...marks.map(mark => 'Heads-up: ' + usptoLink(mark.mark || check.query.name, mark.url)
|
|
40
|
+
+ ' has an exact live US trademark match' + (mark.owner ? ' (' + md(mark.owner) + ')' : '') + '.'),
|
|
41
|
+
'Search aid, not legal advice.'];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function domainAnswer({ domains, query, choice }) {
|
|
45
|
+
const exact = domains.find(row => row.domain === query.exactDomain);
|
|
46
|
+
const available = domains.find(row => row.status === 'available');
|
|
47
|
+
if (query.exactDomain) {
|
|
48
|
+
const ending = exact?.reason === 'reserved' ? ' is reserved by the registry.'
|
|
49
|
+
: ['available', 'taken'].includes(exact?.status) ? ' is ' + exact.status + '.' : ' could not be confirmed.';
|
|
50
|
+
return md(query.exactDomain) + ending;
|
|
51
|
+
}
|
|
52
|
+
if (choice?.pick) return pickLine(choice.pick);
|
|
53
|
+
if (available) return md(available.domain) + ' is available.';
|
|
54
|
+
return md(query.name) + (domains.length && domains.every(row => row.status === 'taken')
|
|
55
|
+
? ' · All checked endings are taken.' : ' · No available endings confirmed.');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function appNameLines(check, pending, withLinks = true) {
|
|
59
|
+
const app = check.appStore ?? check.nameChecks?.appStore;
|
|
60
|
+
const play = check.googlePlay ?? check.nameChecks?.googlePlay;
|
|
61
|
+
const outcome = row => {
|
|
62
|
+
if (['taken', 'exact_match_found'].includes(row?.status)) return 'Taken';
|
|
63
|
+
if (['not-found', 'no_match_found'].includes(row?.status)) return 'No matching app found';
|
|
64
|
+
return row?.status === 'pending' || (!row && pending) ? 'Still checking' : 'Couldn’t check';
|
|
65
|
+
};
|
|
66
|
+
const match = withLinks && app?.matches?.[0];
|
|
67
|
+
return ['App Store (iOS) · ' + outcome(app) + (match ? ' · ' + link(match.name, match.url) : ''),
|
|
68
|
+
'Google Play (Android) · ' + outcome(play) + (withLinks ? ' · '
|
|
69
|
+
+ link(googlePlayLinkLabel, play?.link ?? playSearchLink(check.query.name)) : '')];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function hostedIntroLines(check, pending, markLimit = 10, withAppLinks = true) {
|
|
73
|
+
return [domainAnswer(check), ...appNameLines(check, pending, withAppLinks), ...trademarkLines(check, pending, markLimit)];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function nameCheckLines(details, pending) {
|
|
77
|
+
if (!details) return [pending ? 'Name checks are still running. Call the same tool with the same input to collect them.' : 'Name checks could not be completed.'];
|
|
78
|
+
return platforms.flatMap(platform => {
|
|
79
|
+
const handle = details.handles?.find(row => row.platform === platform);
|
|
80
|
+
if (!handle) return [];
|
|
81
|
+
const label = handleLabel(handle);
|
|
82
|
+
return platform + ' · ' + (handle.linkLabel ? label + ' · ' + link(handle.linkLabel, handle.link) : link(label, handle.link));
|
|
83
|
+
});
|
|
51
84
|
}
|
|
52
85
|
|
|
53
86
|
function priceLine(offer, cheapest) {
|
|
@@ -55,34 +88,37 @@ function priceLine(offer, cheapest) {
|
|
|
55
88
|
return link(offer.shop, offer.buyUrl) + (cheapest ? ' (cheapest over three years)' : '') + ' · '
|
|
56
89
|
+ money(offer.firstYearUsd) + ' first year · ' + money(offer.renewalUsd) + ' yearly renewal · '
|
|
57
90
|
+ money(offer.threeYearUsd) + ' over three years' + term
|
|
58
|
-
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '')
|
|
91
|
+
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '')
|
|
92
|
+
+ (offer.checkedAt && offer.source ? ' · ' + link(offer.checkedAt.slice(0, 10), offer.source) : '');
|
|
59
93
|
}
|
|
60
94
|
|
|
61
95
|
export function pickLine(pick) {
|
|
62
96
|
return 'The Hound’s pick is ' + md(pick.domain) + ' at ' + md(pick.shop) + ' for ' + money(pick.threeYearUsd) + ' over three years.';
|
|
63
97
|
}
|
|
64
98
|
|
|
65
|
-
export function checkLines(check, pending, { local = false } = {}) {
|
|
99
|
+
export function checkLines(check, pending, { local = false, includePick = true } = {}) {
|
|
66
100
|
const { domains, choice, nameChecks, score } = check;
|
|
67
101
|
const pick = choice?.pick;
|
|
68
102
|
const taken = domains.filter(row => row.status === 'taken').map(row => row.domain);
|
|
69
|
-
const
|
|
103
|
+
const reserved = domains.filter(row => row.reason === 'reserved');
|
|
104
|
+
const unknown = domains.filter(row => row.status === 'unknown' && row.reason !== 'reserved');
|
|
70
105
|
return [
|
|
71
106
|
...(score?.filtered ? [md(check.query.name) + ' · ' + md(score.filtered)]
|
|
72
107
|
: Number.isInteger(score?.value) ? [md(check.query.name) + ' · Name score ' + score.value + '/100 · ' + md(score.band),
|
|
73
108
|
...(score.reasons ?? []).map(md)] : []),
|
|
74
|
-
...(pick ? [pickLine(pick)] : []),
|
|
109
|
+
...(pick && includePick ? [pickLine(pick)] : []),
|
|
75
110
|
...domains.filter(row => row.status === 'available').flatMap(row => [
|
|
76
111
|
'Available · ' + md(row.domain),
|
|
77
112
|
...(row.prices?.length ? row.prices.map((offer, index) => priceLine(offer, !local && index === 0)) : ['Check the price at the shop.']),
|
|
78
113
|
...(local && row.confirmed ? ['Confirmed at the shop.'] : []),
|
|
79
114
|
]),
|
|
80
|
-
...(local ? [] : nameCheckLines(nameChecks, pending, check.query.name)),
|
|
81
115
|
...(taken.length ? ['Taken · ' + taken.map(md).join(', ') + '. '
|
|
82
116
|
+ link('Watch', 'https://domainhound.dev/watch/?domain=' + encodeURIComponent(taken[0]))
|
|
83
117
|
+ ' · Draft an offer · Try a new name'] : []),
|
|
118
|
+
...(reserved.length ? ['Reserved by the registry · ' + reserved.map(row => md(row.domain)).join(', ') + '.'] : []),
|
|
84
119
|
...(unknown.length ? ['Could not confirm ' + (domains.length === 1 ? md(unknown[0].domain)
|
|
85
120
|
: unknown.length + (unknown.length === 1 ? ' ending' : ' endings')) + '.'] : []),
|
|
121
|
+
...(local ? [] : nameCheckLines(nameChecks, pending)),
|
|
86
122
|
];
|
|
87
123
|
}
|
|
88
124
|
|
|
@@ -109,14 +145,14 @@ export function hostedChecks(checks, args, triage = false) {
|
|
|
109
145
|
return checks.map(check => {
|
|
110
146
|
const pick = preferredPick(check, args);
|
|
111
147
|
if (!triage) return pick === check.choice.pick ? check : { ...check, choice: { ...check.choice, pick } };
|
|
112
|
-
const us = check
|
|
148
|
+
const us = usTrademark(check);
|
|
113
149
|
const score = scoreName({
|
|
114
150
|
name: check.query.name,
|
|
115
151
|
candidate: candidates.get(normalizeName(check.query.name)),
|
|
116
152
|
domains: check.domains.filter(row => row.status === 'available' && canRecommend(row.ending, args.eligible)
|
|
117
153
|
&& (!args.endings?.length || args.endings.includes(row.ending)))
|
|
118
154
|
.map(row => ({ ending: row.ending, total: row.prices[0]?.threeYearUsd, registry: true })),
|
|
119
|
-
marks: { us: us?.status
|
|
155
|
+
marks: { us: ['exact_match_found', 'no_exact_match_found'].includes(us?.status) ? 'ok' : 'unknown',
|
|
120
156
|
list: us?.marks.map(mark => ({ tier: 'Exact', live: true,
|
|
121
157
|
sameClass: mark.classes?.length ? mark.classes.some(value => classes.includes(value)) : null })) },
|
|
122
158
|
apps: { list: check.nameChecks?.appStore?.matches },
|
|
@@ -137,16 +173,24 @@ export function generatedChecks(generation) {
|
|
|
137
173
|
}));
|
|
138
174
|
}
|
|
139
175
|
|
|
140
|
-
export function
|
|
141
|
-
|
|
176
|
+
export function visibleChecks(checks, args, generation) {
|
|
177
|
+
return !generation && args.shortlist && checks.some(check => check.score)
|
|
142
178
|
? checks.filter(check => scoreEligible(check)).sort((a, b) => compareScores(a.score, b.score)).slice(0, 8) : checks;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function hostedResult(checks, args, generation, { pending = false, failed = false, checkedAt } = {}) {
|
|
182
|
+
const shown = visibleChecks(checks, args, generation);
|
|
183
|
+
const warnings = checks.filter(check => !shown.includes(check) && usTrademark(check)?.status === 'exact_match_found')
|
|
184
|
+
.flatMap(check => trademarkLines(check, pending));
|
|
143
185
|
const lines = [
|
|
144
|
-
...checks.flatMap(warning),
|
|
145
186
|
...(shown.length ? shown.flatMap((check, index) => [
|
|
146
|
-
...(
|
|
147
|
-
...checkLines(check, pending),
|
|
187
|
+
...(generation && !check.domains.length ? [md(check.query.name)] : hostedIntroLines(check, pending)),
|
|
188
|
+
...checkLines(check, pending, { includePick: false }),
|
|
148
189
|
...(index < shown.length - 1 ? [''] : []),
|
|
149
|
-
]) : [pending
|
|
190
|
+
]) : [pending && generation?.suggestions?.length
|
|
191
|
+
? 'Checking domains for ' + generation.suggestions.map(entry => md(entry.name)).join(', ') + '.'
|
|
192
|
+
: pending ? 'Still checking names and domains.' : 'No names passed the checks.']),
|
|
193
|
+
...warnings,
|
|
150
194
|
...(pending ? ['The results page updates when the remaining checks finish.'] : []),
|
|
151
195
|
...(failed ? ['The remaining checks did not finish.'] : []),
|
|
152
196
|
...(generation?.question && !pending ? [md(generation.question)] : []),
|
|
@@ -157,12 +201,14 @@ export function hostedResult(checks, args, generation, { pending = false, failed
|
|
|
157
201
|
const rows = status => check.domains.filter(row => row.status === status);
|
|
158
202
|
return { name: check.query.exactDomain ?? check.query.name,
|
|
159
203
|
available: rows('available').map(row => row.ending), free: rows('available').map(row => ({ d: row.ending })),
|
|
160
|
-
taken: rows('taken').map(row => 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),
|
|
161
207
|
...(check.score && { score: check.score }) };
|
|
162
208
|
});
|
|
163
209
|
const { details, ...generationResult } = generation ?? {};
|
|
164
210
|
return { hosted: true, checks, names, ...(generation && { generation: generationResult }), ...(pending && { pending: true }),
|
|
165
|
-
complete: generation ? !pending && !failed && generation.complete : checks.every(check => check.complete),
|
|
211
|
+
complete: generation ? !pending && !failed && generation.complete : !pending && checks.every(check => check.complete),
|
|
166
212
|
checkedAt: checkedAt ?? generation?.checkedAt ?? checks[0]?.checkedAt ?? new Date().toISOString(),
|
|
167
213
|
lines: attributed(lines.join('\n'), Boolean(args.purchase || (checks.length === 1 && checks[0].query.exactDomain))).split('\n') };
|
|
168
214
|
}
|
package/hosted.mjs
CHANGED
|
@@ -2,9 +2,12 @@ import { setTimeout as wait } from 'node:timers/promises';
|
|
|
2
2
|
import { checkGooglePlayNames, checkSocialHandles, embedChecksEnabled, handleLabel, handleStates, publicProfiles } from './clis/domain-check/handles.mjs';
|
|
3
3
|
import { googlePlayLabel, googlePlayLinkLabel, playSearchLink } from './clis/domain-check/google-play.mjs';
|
|
4
4
|
import { normalizeName } from './clis/domain-check/name-search.mjs';
|
|
5
|
+
import { rdapSignal } from './clis/domain-check/registry.mjs';
|
|
5
6
|
import { searchApps } from './clis/domain-check/triage-sources.mjs';
|
|
6
7
|
|
|
7
8
|
export const hostedBase = 'https://domainhound-mcp.domainhound.workers.dev';
|
|
9
|
+
// Page-only evidence. Symbols survive the internal object spreads and stay out of MCP JSON.
|
|
10
|
+
export const alternativeEndings = Symbol('alternative endings');
|
|
8
11
|
export class HostedRateLimit extends Error {}
|
|
9
12
|
|
|
10
13
|
export function hostedDebug(message, env = process.env) {
|
|
@@ -25,6 +28,39 @@ const validDetails = body => body?.version === 1 && body.appStore && body.google
|
|
|
25
28
|
Array.isArray(body.trademarks?.us?.marks) && Array.isArray(body.handles);
|
|
26
29
|
const validGeneration = body => body?.version === 2 && ['initial', 'final'].includes(body.stage) && Array.isArray(body.names);
|
|
27
30
|
|
|
31
|
+
// Only the IANA-listed Google Registry route for the returned .app or .dev domain is eligible.
|
|
32
|
+
async function observeRdap(row, ascii, fetchFn, signal) {
|
|
33
|
+
if (row.status !== 'unknown' || !['dev', 'app'].includes(row.ending) ||
|
|
34
|
+
!/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(ascii) ||
|
|
35
|
+
row.domain !== ascii + '.' + row.ending ||
|
|
36
|
+
row.rdapUrl !== 'https://pubapi.registry.google/rdap/domain/' + row.domain) return null;
|
|
37
|
+
try {
|
|
38
|
+
const timeout = AbortSignal.timeout(1600);
|
|
39
|
+
const response = await fetchFn(row.rdapUrl, { redirect: 'error', credentials: 'omit', cache: 'no-store',
|
|
40
|
+
headers: { Accept: 'application/rdap+json, application/json' },
|
|
41
|
+
signal: signal ? AbortSignal.any([signal, timeout]) : timeout });
|
|
42
|
+
const age = Number(response.headers.get('age') ?? 0);
|
|
43
|
+
const type = response.headers.get('content-type')?.split(';', 1)[0].trim().toLowerCase();
|
|
44
|
+
if (![200, 404].includes(response.status) || !Number.isFinite(age) || age > 0 ||
|
|
45
|
+
!['application/rdap+json', 'application/json'].includes(type)) {
|
|
46
|
+
await response.body?.cancel().catch(() => {});
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const json = await response.text();
|
|
50
|
+
const body = JSON.parse(json);
|
|
51
|
+
if (response.status === 200) {
|
|
52
|
+
return body?.objectClassName === 'domain' && typeof body.ldhName === 'string' &&
|
|
53
|
+
body.ldhName.toLowerCase().replace(/\.$/, '') === row.domain &&
|
|
54
|
+
!body.status?.some?.(value => /^(reserved|not available)$/i.test(value)) ? row.ending + ':taken' : null;
|
|
55
|
+
}
|
|
56
|
+
const hint = rdapSignal(json);
|
|
57
|
+
return body?.errorCode === 404 && hint !== 'reserved'
|
|
58
|
+
? row.ending + ':' + (hint ?? 'available') : null;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
28
64
|
export function hostedClient(version, { env = process.env, fetchFn = fetch, apple = searchApps } = {}) {
|
|
29
65
|
if (env.DOMAIN_HOUND_LOCAL === '1') return null;
|
|
30
66
|
let base;
|
|
@@ -86,7 +122,15 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
86
122
|
}
|
|
87
123
|
}
|
|
88
124
|
|
|
89
|
-
|
|
125
|
+
async function get(name, signal) {
|
|
126
|
+
const params = new URLSearchParams({ name });
|
|
127
|
+
const options = { params, timeout: 4200, signal, valid: validCheck };
|
|
128
|
+
const initial = await read('/v1/check', options, true);
|
|
129
|
+
const seen = (await Promise.all(initial.domains.map(row => observeRdap(row, initial.query.ascii, fetchFn, signal)))).filter(Boolean);
|
|
130
|
+
if (!seen.length) return initial;
|
|
131
|
+
seen.forEach(observation => params.append('seen', observation));
|
|
132
|
+
return read('/v1/check', options).catch(() => initial);
|
|
133
|
+
}
|
|
90
134
|
|
|
91
135
|
async function recoverApple(app, name, signal) {
|
|
92
136
|
if (app?.status !== 'unknown' || app.reason !== 'rate-limited') return app;
|
|
@@ -149,18 +193,33 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
149
193
|
}
|
|
150
194
|
|
|
151
195
|
return {
|
|
152
|
-
async check(name, extraEndings, signal) {
|
|
196
|
+
async check(name, extraEndings, signal, onDomains) {
|
|
153
197
|
const [main, ...extras] = await Promise.all([get(name, signal),
|
|
154
198
|
...extraEndings.map(ending => get(normalizeName(name) + '.' + ending, signal))]);
|
|
199
|
+
const { details, ...answer } = main;
|
|
200
|
+
answer.domains = [...main.domains, ...extras.flatMap(extra => extra.domains)];
|
|
201
|
+
answer.complete = main.complete && extras.every(extra => extra.complete);
|
|
202
|
+
const exact = main.query.exactDomain;
|
|
203
|
+
const needsAlternatives = exact && main.domains.length === 1 && main.domains[0].domain === exact && main.domains[0].status === 'taken';
|
|
204
|
+
// Run alongside the name checks. An unavailable comparison must not discard the exact answer.
|
|
205
|
+
const alternatives = needsAlternatives ? get(main.query.ascii, signal).then(comparison =>
|
|
206
|
+
comparison.query.ascii === main.query.ascii ? {
|
|
207
|
+
domains: comparison.domains, choice: comparison.choice, priceSnapshot: comparison.priceSnapshot,
|
|
208
|
+
share: comparison.share, complete: comparison.complete,
|
|
209
|
+
} : null).catch(() => null) : null;
|
|
155
210
|
let nameChecks = null;
|
|
156
|
-
if (typeof
|
|
211
|
+
if (typeof details?.id === 'string') {
|
|
212
|
+
onDomains?.(answer);
|
|
157
213
|
nameChecks = await read('/v1/check/details', {
|
|
158
|
-
params: { id:
|
|
214
|
+
params: { id: details.id }, timeout: 5300, signal: AbortSignal.any([signal, AbortSignal.timeout(5700)]), valid: validDetails,
|
|
159
215
|
}, true).catch(() => null);
|
|
160
216
|
} else {
|
|
161
217
|
hostedDebug('/v1/check did not provide a name-check token', env);
|
|
162
218
|
}
|
|
163
219
|
if (nameChecks) {
|
|
220
|
+
const definite = row => row && !['pending', 'unknown'].includes(row.status);
|
|
221
|
+
if (definite(answer.appStore)) nameChecks.appStore = answer.appStore;
|
|
222
|
+
if (definite(answer.googlePlay)) nameChecks.googlePlay = answer.googlePlay;
|
|
164
223
|
const recovered = await Promise.allSettled([
|
|
165
224
|
recoverApple(nameChecks.appStore, main.query.name, signal).then(app => { nameChecks.appStore = app; }),
|
|
166
225
|
recoverNameChecks([{ name: main.query.name, nameChecks }], signal),
|
|
@@ -169,9 +228,13 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
169
228
|
if (result.status === 'rejected') hostedDebug('Optional ' + (index ? 'handle' : 'App Store') + ' recovery failed', env);
|
|
170
229
|
}
|
|
171
230
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
231
|
+
const best = (first, next) => first && !['unknown', 'pending'].includes(first.status) ? first
|
|
232
|
+
: next ?? (first?.status === 'pending' ? { ...first, status: 'unknown' } : first);
|
|
233
|
+
const appStore = best(answer.appStore, nameChecks?.appStore);
|
|
234
|
+
const googlePlay = best(answer.googlePlay, nameChecks?.googlePlay);
|
|
235
|
+
const mark = best(answer.trademarks?.us, nameChecks?.trademarks?.us);
|
|
236
|
+
return { ...answer, ...(needsAlternatives && { [alternativeEndings]: await alternatives }), nameChecks,
|
|
237
|
+
...(appStore && { appStore }), ...(googlePlay && { googlePlay }), ...(mark && { trademarks: { us: mark } }) };
|
|
175
238
|
},
|
|
176
239
|
|
|
177
240
|
async generate(args, signal) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domain-hound",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
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",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"display.mjs",
|
|
46
46
|
"results.mjs",
|
|
47
47
|
"results-style.mjs",
|
|
48
|
+
"results-cards.mjs",
|
|
48
49
|
"share.mjs",
|
|
49
50
|
"site/r/share-format.mjs",
|
|
50
51
|
"watch.mjs",
|
|
@@ -98,6 +99,7 @@
|
|
|
98
99
|
"clis/portfolio/transfer-prices.mjs",
|
|
99
100
|
"assets/",
|
|
100
101
|
"skills/naming/SKILL.md",
|
|
102
|
+
"skills/domains/SKILL.md",
|
|
101
103
|
".claude-plugin/plugin.json",
|
|
102
104
|
".claude-plugin/marketplace.json",
|
|
103
105
|
".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.12",
|
|
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"
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
],
|
|
25
25
|
"websiteURL": "https://domainhound.dev",
|
|
26
26
|
"privacyPolicyURL": "https://domainhound.dev/privacy/",
|
|
27
|
+
"termsOfServiceURL": "https://domainhound.dev/privacy/#terms",
|
|
27
28
|
"supportURL": "https://github.com/lars-hv/domain-hound/issues",
|
|
28
29
|
"logo": "./assets/icon-1024.png",
|
|
29
30
|
"composerIcon": "./assets/icon-512.png"
|