domain-hound 0.1.9 → 0.1.11
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 +25 -6
- package/assets/mulish-OFL.txt +93 -0
- package/assets/mulish-latin-wght-normal.woff2 +0 -0
- package/assets/results.css +175 -0
- package/clis/domain-check/handles.mjs +2 -2
- package/clis/domain-check/index.mjs +1 -1
- package/clis/domain-check/name-search.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/display.mjs +2 -1
- package/dossier.mjs +5 -5
- package/hosted-results.mjs +36 -14
- package/hosted.mjs +123 -24
- package/package.json +3 -1
- package/plugin.json +2 -1
- package/results-cards.mjs +169 -0
- package/results-style.mjs +9 -0
- package/results.mjs +190 -130
- package/server.json +2 -2
- package/server.mjs +228 -66
- 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/display.mjs
CHANGED
|
@@ -8,6 +8,7 @@ export { purchaseLine, showAsIs } from './clis/domain-check/naming-method.mjs';
|
|
|
8
8
|
import { compareScores } from './clis/domain-check/name-score.mjs';
|
|
9
9
|
export const neverBuys = 'This check leaves checkout to you; open the link to buy.';
|
|
10
10
|
export const attribution = 'via domainhound.dev';
|
|
11
|
+
export const localCheckNotice = 'Checked on your machine; the shared price list was unreachable.';
|
|
11
12
|
|
|
12
13
|
// Every MCP display carries one attribution line. The blank line keeps it out of a preceding table or list.
|
|
13
14
|
// When the display can show a checkout link, an exact lookup or purchase request can add the purchase line after it.
|
|
@@ -82,7 +83,7 @@ function preferredFirst(values, preferred, endingOf = value => value) {
|
|
|
82
83
|
|
|
83
84
|
// A data-only shop has no search URL (null), so a missing URL must never match it.
|
|
84
85
|
export function safeLink(url, domain) {
|
|
85
|
-
if (typeof url !== 'string' || !url || !/^[a-z0-9-]+\.[a-z0-9-]
|
|
86
|
+
if (typeof url !== 'string' || !url || !/^[a-z0-9-]+\.(?:co\.uk|[a-z0-9-]+)$/i.test(domain) ||
|
|
86
87
|
!registrarIds.some(id => shopSearchUrl(id, domain) === url)) return null;
|
|
87
88
|
return '[' + domain + '](' + url + ')';
|
|
88
89
|
}
|
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
|
@@ -27,8 +27,8 @@ function warning(check) {
|
|
|
27
27
|
+ '. The match applies to the name across all endings.');
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
function nameCheckLines(details, pending, name) {
|
|
31
|
-
if (!details) return [pending ? 'Name checks are still running.' : 'Name checks could not be completed.'];
|
|
30
|
+
export function nameCheckLines(details, pending, name) {
|
|
31
|
+
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.'];
|
|
32
32
|
const { appStore: app, googlePlay, trademarks, handles } = details;
|
|
33
33
|
const appText = app.status === 'taken' ? 'Matching app found' : app.status === 'no_match_found' ? 'No matching app found'
|
|
34
34
|
: app.reason === 'rate-limited' ? 'Search rate-limited' : 'Could not complete the search';
|
|
@@ -55,32 +55,46 @@ function priceLine(offer, cheapest) {
|
|
|
55
55
|
return link(offer.shop, offer.buyUrl) + (cheapest ? ' (cheapest over three years)' : '') + ' · '
|
|
56
56
|
+ money(offer.firstYearUsd) + ' first year · ' + money(offer.renewalUsd) + ' yearly renewal · '
|
|
57
57
|
+ money(offer.threeYearUsd) + ' over three years' + term
|
|
58
|
-
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '')
|
|
58
|
+
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '')
|
|
59
|
+
+ (offer.checkedAt && offer.source ? ' · ' + link(offer.checkedAt.slice(0, 10), offer.source) : '');
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
function
|
|
62
|
+
export function pickLine(pick) {
|
|
63
|
+
return 'The Hound’s pick is ' + md(pick.domain) + ' at ' + md(pick.shop) + ' for ' + money(pick.threeYearUsd) + ' over three years.';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function checkLines(check, pending, { local = false } = {}) {
|
|
62
67
|
const { domains, choice, nameChecks, score } = check;
|
|
63
68
|
const pick = choice?.pick;
|
|
64
69
|
const taken = domains.filter(row => row.status === 'taken').map(row => row.domain);
|
|
65
|
-
const
|
|
70
|
+
const reserved = domains.filter(row => row.reason === 'reserved');
|
|
71
|
+
const unknown = domains.filter(row => row.status === 'unknown' && row.reason !== 'reserved');
|
|
66
72
|
return [
|
|
67
73
|
...(score?.filtered ? [md(check.query.name) + ' · ' + md(score.filtered)]
|
|
68
74
|
: Number.isInteger(score?.value) ? [md(check.query.name) + ' · Name score ' + score.value + '/100 · ' + md(score.band),
|
|
69
75
|
...(score.reasons ?? []).map(md)] : []),
|
|
70
|
-
...(pick ? [
|
|
76
|
+
...(pick ? [pickLine(pick)] : []),
|
|
71
77
|
...domains.filter(row => row.status === 'available').flatMap(row => [
|
|
72
78
|
'Available · ' + md(row.domain),
|
|
73
|
-
...(row.prices?.length ? row.prices.map((offer, index) => priceLine(offer, index === 0)) : ['Check the price at the shop.']),
|
|
79
|
+
...(row.prices?.length ? row.prices.map((offer, index) => priceLine(offer, !local && index === 0)) : ['Check the price at the shop.']),
|
|
80
|
+
...(local && row.confirmed ? ['Confirmed at the shop.'] : []),
|
|
74
81
|
]),
|
|
75
|
-
...nameCheckLines(nameChecks, pending, check.query.name),
|
|
82
|
+
...(local ? [] : nameCheckLines(nameChecks, pending, check.query.name)),
|
|
76
83
|
...(taken.length ? ['Taken · ' + taken.map(md).join(', ') + '. '
|
|
77
84
|
+ link('Watch', 'https://domainhound.dev/watch/?domain=' + encodeURIComponent(taken[0]))
|
|
78
85
|
+ ' · Draft an offer · Try a new name'] : []),
|
|
86
|
+
...(reserved.length ? ['Reserved by the registry · ' + reserved.map(row => md(row.domain)).join(', ') + '.'] : []),
|
|
79
87
|
...(unknown.length ? ['Could not confirm ' + (domains.length === 1 ? md(unknown[0].domain)
|
|
80
88
|
: unknown.length + (unknown.length === 1 ? ' ending' : ' endings')) + '.'] : []),
|
|
81
89
|
];
|
|
82
90
|
}
|
|
83
91
|
|
|
92
|
+
export function pickDomain(options, { endings, eligible, budget } = {}) {
|
|
93
|
+
return choosePick(options.filter(option => option.buyUrl), {
|
|
94
|
+
requested: endings, eligible, budget, allowOverCap: budget != null,
|
|
95
|
+
}) ?? null;
|
|
96
|
+
}
|
|
97
|
+
|
|
84
98
|
function preferredPick(check, args) {
|
|
85
99
|
if (!args.endings?.length && args.budget == null && !args.eligible?.length && !args.country) return check.choice.pick;
|
|
86
100
|
if (check.query.exactDomain) return check.choice.pick;
|
|
@@ -89,7 +103,7 @@ function preferredPick(check, args) {
|
|
|
89
103
|
row.prices.filter(offer => args.budget == null || offer.firstPaymentUsd <= args.budget).map(offer => ({
|
|
90
104
|
...offer, domain: row.domain, now: offer.firstPaymentUsd, total: offer.threeYearUsd,
|
|
91
105
|
})));
|
|
92
|
-
return
|
|
106
|
+
return pickDomain(options, args);
|
|
93
107
|
}
|
|
94
108
|
|
|
95
109
|
export function hostedChecks(checks, args, triage = false) {
|
|
@@ -126,16 +140,22 @@ export function generatedChecks(generation) {
|
|
|
126
140
|
}));
|
|
127
141
|
}
|
|
128
142
|
|
|
129
|
-
export function
|
|
130
|
-
|
|
143
|
+
export function visibleChecks(checks, args, generation) {
|
|
144
|
+
return !generation && args.shortlist && checks.some(check => check.score)
|
|
131
145
|
? checks.filter(check => scoreEligible(check)).sort((a, b) => compareScores(a.score, b.score)).slice(0, 8) : checks;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function hostedResult(checks, args, generation, { pending = false, failed = false, checkedAt } = {}) {
|
|
149
|
+
const shown = visibleChecks(checks, args, generation);
|
|
132
150
|
const lines = [
|
|
133
151
|
...checks.flatMap(warning),
|
|
134
152
|
...(shown.length ? shown.flatMap((check, index) => [
|
|
135
153
|
...(shown.length > 1 ? [md(check.query.exactDomain ?? check.query.name)] : []),
|
|
136
154
|
...checkLines(check, pending),
|
|
137
155
|
...(index < shown.length - 1 ? [''] : []),
|
|
138
|
-
]) : [pending
|
|
156
|
+
]) : [pending && generation?.suggestions?.length
|
|
157
|
+
? 'Checking domains for ' + generation.suggestions.map(entry => md(entry.name)).join(', ') + '.'
|
|
158
|
+
: pending ? 'Still checking names and domains.' : 'No names passed the checks.']),
|
|
139
159
|
...(pending ? ['The results page updates when the remaining checks finish.'] : []),
|
|
140
160
|
...(failed ? ['The remaining checks did not finish.'] : []),
|
|
141
161
|
...(generation?.question && !pending ? [md(generation.question)] : []),
|
|
@@ -146,12 +166,14 @@ export function hostedResult(checks, args, generation, { pending = false, failed
|
|
|
146
166
|
const rows = status => check.domains.filter(row => row.status === status);
|
|
147
167
|
return { name: check.query.exactDomain ?? check.query.name,
|
|
148
168
|
available: rows('available').map(row => row.ending), free: rows('available').map(row => ({ d: row.ending })),
|
|
149
|
-
taken: rows('taken').map(row => row.ending),
|
|
169
|
+
taken: rows('taken').map(row => row.ending),
|
|
170
|
+
reserved: rows('unknown').filter(row => row.reason === 'reserved').map(row => row.ending),
|
|
171
|
+
shop_check: rows('unknown').filter(row => row.reason !== 'reserved').map(row => row.ending),
|
|
150
172
|
...(check.score && { score: check.score }) };
|
|
151
173
|
});
|
|
152
174
|
const { details, ...generationResult } = generation ?? {};
|
|
153
175
|
return { hosted: true, checks, names, ...(generation && { generation: generationResult }), ...(pending && { pending: true }),
|
|
154
|
-
complete: generation ? !pending && !failed && generation.complete : checks.every(check => check.complete),
|
|
176
|
+
complete: generation ? !pending && !failed && generation.complete : !pending && checks.every(check => check.complete),
|
|
155
177
|
checkedAt: checkedAt ?? generation?.checkedAt ?? checks[0]?.checkedAt ?? new Date().toISOString(),
|
|
156
178
|
lines: attributed(lines.join('\n'), Boolean(args.purchase || (checks.length === 1 && checks[0].query.exactDomain))).split('\n') };
|
|
157
179
|
}
|
package/hosted.mjs
CHANGED
|
@@ -2,11 +2,25 @@ 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
|
|
|
13
|
+
export function hostedDebug(message, env = process.env) {
|
|
14
|
+
if (env.DOMAIN_HOUND_DEBUG === '1') process.stderr.write('Domain Hound: ' + message + '\n');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class HostedRequestError extends Error {
|
|
18
|
+
constructor(message, transient = false) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.transient = transient;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
10
24
|
const validCheck = body => body?.version === 1 && typeof body.query?.ascii === 'string' &&
|
|
11
25
|
Array.isArray(body.domains) && body.domains.every(row => typeof row.domain === 'string' &&
|
|
12
26
|
['available', 'taken', 'unknown'].includes(row.status) && Array.isArray(row.prices)) && body.choice;
|
|
@@ -14,39 +28,109 @@ const validDetails = body => body?.version === 1 && body.appStore && body.google
|
|
|
14
28
|
Array.isArray(body.trademarks?.us?.marks) && Array.isArray(body.handles);
|
|
15
29
|
const validGeneration = body => body?.version === 2 && ['initial', 'final'].includes(body.stage) && Array.isArray(body.names);
|
|
16
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
|
+
|
|
17
64
|
export function hostedClient(version, { env = process.env, fetchFn = fetch, apple = searchApps } = {}) {
|
|
18
65
|
if (env.DOMAIN_HOUND_LOCAL === '1') return null;
|
|
19
66
|
let base;
|
|
20
67
|
try {
|
|
21
68
|
base = new URL(env.DOMAIN_HOUND_API_URL || hostedBase);
|
|
22
69
|
const loopback = ['localhost', '127.0.0.1', '[::1]'].includes(base.hostname);
|
|
23
|
-
if (base.username || base.password || (base.protocol !== 'https:' && !(loopback && base.protocol === 'http:')))
|
|
70
|
+
if (base.username || base.password || (base.protocol !== 'https:' && !(loopback && base.protocol === 'http:'))) {
|
|
71
|
+
throw new Error('Invalid hosted API origin');
|
|
72
|
+
}
|
|
24
73
|
} catch {
|
|
74
|
+
hostedDebug('Hosted API origin is invalid; using the local check.', env);
|
|
25
75
|
return null;
|
|
26
76
|
}
|
|
27
77
|
|
|
28
|
-
async function
|
|
78
|
+
async function request(path, { body, params, timeout, signal, valid } = {}) {
|
|
29
79
|
const url = new URL(path, base);
|
|
30
80
|
if (params) url.search = new URLSearchParams(params).toString();
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
81
|
+
const deadline = AbortSignal.timeout(timeout);
|
|
82
|
+
let res;
|
|
83
|
+
try {
|
|
84
|
+
res = await fetchFn(url, {
|
|
85
|
+
redirect: 'error',
|
|
86
|
+
headers: { 'X-Domain-Hound-Client': 'mcp/' + version, ...(body && { 'Content-Type': 'application/json' }) },
|
|
87
|
+
...(body && { method: 'POST', body: JSON.stringify(body) }),
|
|
88
|
+
signal: signal ? AbortSignal.any([signal, deadline]) : deadline,
|
|
89
|
+
});
|
|
90
|
+
} catch (error) {
|
|
91
|
+
const code = error?.cause?.code;
|
|
92
|
+
const reason = signal?.aborted ? 'lookup stopped' : deadline.aborted ? 'request timed out'
|
|
93
|
+
: 'connection failed' + (/^(?:E[A-Z_0-9]+|UND_ERR_[A-Z_0-9]+)$/.test(code ?? '') ? ' (' + code + ')' : '');
|
|
94
|
+
throw new HostedRequestError(reason, true);
|
|
95
|
+
}
|
|
37
96
|
if (!res.ok) {
|
|
38
97
|
await res.body?.cancel().catch(() => {});
|
|
39
|
-
if (res.status === 429) throw new HostedRateLimit();
|
|
40
|
-
throw new
|
|
98
|
+
if (res.status === 429) throw new HostedRateLimit('HTTP 429');
|
|
99
|
+
throw new HostedRequestError('HTTP ' + res.status, res.status === 408 || res.status >= 500);
|
|
41
100
|
}
|
|
42
|
-
|
|
101
|
+
const answer = await res.json().catch(() => {
|
|
102
|
+
throw new HostedRequestError(signal?.aborted ? 'lookup stopped' : deadline.aborted
|
|
103
|
+
? 'response timed out' : 'invalid or incomplete JSON response', true);
|
|
104
|
+
});
|
|
105
|
+
if (valid && !valid(answer)) throw new HostedRequestError('response did not match the API format', true);
|
|
106
|
+
return answer;
|
|
43
107
|
}
|
|
44
108
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
109
|
+
async function read(path, options, retry = false) {
|
|
110
|
+
for (let attempt = 1; ; attempt++) {
|
|
111
|
+
const started = performance.now();
|
|
112
|
+
try {
|
|
113
|
+
return await request(path, options);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
const retrying = retry && attempt === 1 && error.transient && !options.signal?.aborted;
|
|
116
|
+
hostedDebug(path + ' attempt ' + attempt + ' failed after ' + Math.round(performance.now() - started)
|
|
117
|
+
+ ' ms (' + (error instanceof HostedRequestError || error instanceof HostedRateLimit ? error.message : 'unexpected error')
|
|
118
|
+
+ ')' + (retrying ? '; retrying' : ''), env);
|
|
119
|
+
if (!retrying) throw error;
|
|
120
|
+
await wait(200, undefined, { signal: options.signal });
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
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
|
+
}
|
|
50
134
|
|
|
51
135
|
async function recoverApple(app, name, signal) {
|
|
52
136
|
if (app?.status !== 'unknown' || app.reason !== 'rate-limited') return app;
|
|
@@ -109,24 +193,39 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
109
193
|
}
|
|
110
194
|
|
|
111
195
|
return {
|
|
112
|
-
async check(name, extraEndings, signal) {
|
|
196
|
+
async check(name, extraEndings, signal, onDomains) {
|
|
113
197
|
const [main, ...extras] = await Promise.all([get(name, signal),
|
|
114
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;
|
|
115
210
|
let nameChecks = null;
|
|
116
|
-
if (typeof
|
|
211
|
+
if (typeof details?.id === 'string') {
|
|
212
|
+
onDomains?.(answer);
|
|
117
213
|
nameChecks = await read('/v1/check/details', {
|
|
118
|
-
params: { id:
|
|
119
|
-
}).
|
|
214
|
+
params: { id: details.id }, timeout: 5300, signal: AbortSignal.any([signal, AbortSignal.timeout(5700)]), valid: validDetails,
|
|
215
|
+
}, true).catch(() => null);
|
|
216
|
+
} else {
|
|
217
|
+
hostedDebug('/v1/check did not provide a name-check token', env);
|
|
120
218
|
}
|
|
121
219
|
if (nameChecks) {
|
|
122
|
-
await Promise.
|
|
220
|
+
const recovered = await Promise.allSettled([
|
|
123
221
|
recoverApple(nameChecks.appStore, main.query.name, signal).then(app => { nameChecks.appStore = app; }),
|
|
124
222
|
recoverNameChecks([{ name: main.query.name, nameChecks }], signal),
|
|
125
223
|
]);
|
|
224
|
+
for (const [index, result] of recovered.entries()) {
|
|
225
|
+
if (result.status === 'rejected') hostedDebug('Optional ' + (index ? 'handle' : 'App Store') + ' recovery failed', env);
|
|
226
|
+
}
|
|
126
227
|
}
|
|
127
|
-
|
|
128
|
-
return { ...answer, domains: [...main.domains, ...extras.flatMap(extra => extra.domains)], nameChecks,
|
|
129
|
-
complete: main.complete && extras.every(extra => extra.complete) };
|
|
228
|
+
return { ...answer, ...(needsAlternatives && { [alternativeEndings]: await alternatives }), nameChecks };
|
|
130
229
|
},
|
|
131
230
|
|
|
132
231
|
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.11",
|
|
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.11",
|
|
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"
|