domain-hound 0.1.6 → 0.1.8
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 +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/README.md +55 -16
- package/clis/domain-check/dossier.mjs +16 -13
- package/clis/domain-check/index.mjs +36 -21
- package/clis/domain-check/name-search.mjs +79 -10
- package/clis/domain-check/price-catalog.mjs +26 -7
- package/clis/domain-check/price-snapshot.json +91 -0
- package/clis/domain-check/prices.mjs +5 -0
- package/clis/domain-check/triage.mjs +25 -18
- package/clis/portfolio/checks.mjs +456 -0
- package/clis/portfolio/discover.mjs +175 -0
- package/clis/portfolio/move.mjs +297 -0
- package/clis/portfolio/page.mjs +140 -0
- package/clis/portfolio/portfolio.mjs +212 -0
- package/clis/portfolio/store.mjs +62 -0
- package/clis/portfolio/transfer-prices.mjs +41 -0
- package/clis/spaceship/client.mjs +35 -19
- package/clis/spaceship/tools.mjs +105 -17
- package/clis/spaceship/transfer.mjs +332 -0
- package/display.mjs +61 -41
- package/dossier.mjs +8 -5
- package/package.json +14 -3
- package/plugin.json +8 -8
- package/results.mjs +47 -29
- package/server.json +4 -4
- package/server.mjs +32 -15
- package/share.mjs +4 -2
- package/site/r/share-format.mjs +8 -4
- package/watch.mjs +3 -3
package/plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.1.8",
|
|
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"
|
|
8
8
|
},
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"com.openai": {
|
|
13
13
|
"interface": {
|
|
14
14
|
"displayName": "Domain Hound",
|
|
15
|
-
"shortDescription": "
|
|
16
|
-
"longDescription": "Domain Hound checks registry availability, compares upfront and renewal prices, and screens
|
|
15
|
+
"shortDescription": "Domains for agents",
|
|
16
|
+
"longDescription": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track. Domain Hound finds names and checks registry availability, compares upfront and renewal prices, and screens names for trademarks, app store clashes and web traction. Connect your own Spaceship account to get a live quote, buy with your approval and set up website or mail DNS. You buy through Spaceship’s own MCP, after you approve Spaceship’s confirmation with the price and payment method. Direct purchase is an opt-in in the server settings, and Spaceship checkout is the fallback. It investigates and watches taken domains, plans moves to a cheaper registrar, and keeps track of every domain you own: expiry, DNS, site, email setup and renewal prices. Domain Hound runs on your machine and is open source under the MIT license.",
|
|
17
17
|
"developerName": "Lars Hvinden",
|
|
18
18
|
"category": "Developer Tools",
|
|
19
19
|
"capabilities": [
|
|
20
|
-
"
|
|
21
|
-
"Compare
|
|
22
|
-
"
|
|
23
|
-
"
|
|
20
|
+
"Find names and check domains",
|
|
21
|
+
"Compare upfront and renewal prices",
|
|
22
|
+
"Buy and set up DNS at Spaceship",
|
|
23
|
+
"Watch, move and track your domains"
|
|
24
24
|
],
|
|
25
25
|
"websiteURL": "https://domainhound.dev",
|
|
26
26
|
"privacyPolicyURL": "https://domainhound.dev/privacy/",
|
package/results.mjs
CHANGED
|
@@ -4,9 +4,10 @@ import { mkdir, readdir, rename, stat, unlink, writeFile } from 'node:fs/promise
|
|
|
4
4
|
import { homedir, userInfo } from 'node:os';
|
|
5
5
|
import { basename, dirname, join, resolve } from 'node:path';
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
|
-
import { canRecommend, defaultEndings, domainEnding, eligibilityNeed,
|
|
7
|
+
import { canRecommend, choosePick, comparePicks, defaultEndings, domainEnding, eligibilityNeed, lowestTotal, lowestUpfront, normalizeName,
|
|
8
|
+
qualityRank } from './clis/domain-check/name-search.mjs';
|
|
8
9
|
import { handlePriorities, handleStates, handleSummary } from './clis/domain-check/handles.mjs';
|
|
9
|
-
import { shopSearchUrl, shops } from './clis/domain-check/prices.mjs';
|
|
10
|
+
import { dnsNeed, shopSearchUrl, shops } from './clis/domain-check/prices.mjs';
|
|
10
11
|
import { trademarkSearches } from './clis/domain-check/triage-sources.mjs';
|
|
11
12
|
import { safeLink } from './display.mjs';
|
|
12
13
|
import { receiptStyle } from './results-style.mjs';
|
|
@@ -55,11 +56,13 @@ const markLabel = entry => plain(entry.office) + ' mark: ' + plain(entry.tier) +
|
|
|
55
56
|
const watchLink = domain => 'https://domainhound.dev/watch/?domain=' + encodeURIComponent(domain);
|
|
56
57
|
const verdictOrder = { 'No conflict found': 0, 'Check first': 1, Avoid: 2 };
|
|
57
58
|
|
|
58
|
-
function resultGroups(data, eligibleEndings) {
|
|
59
|
+
function resultGroups(data, eligibleEndings, preferred = []) {
|
|
59
60
|
return data.names.map((row, index) => {
|
|
60
61
|
const detail = data.receiptDetails?.[index] ?? {};
|
|
61
62
|
const exact = row.name.includes('.');
|
|
62
63
|
const label = exact ? row.name : normalizeName(row.name);
|
|
64
|
+
const requested = exact ? [...preferred, row.name] : preferred;
|
|
65
|
+
const eligibleList = eligibleEndings ?? data.eligible;
|
|
63
66
|
const listed = [...(row.free ?? []), ...(row.taken ?? []), ...(row.shop_check ?? []), ...(row.resale ?? []),
|
|
64
67
|
...(row.premium ?? []), ...(row.reserved ?? [])].map(value => value.d ?? value).filter(value => typeof value === 'string');
|
|
65
68
|
const variants = listed.filter(value => value.includes('.') && value !== 'co.uk');
|
|
@@ -94,16 +97,20 @@ function resultGroups(data, eligibleEndings) {
|
|
|
94
97
|
const source = ({ web: 'Live site', dns: 'DNS', rdap: 'Registry RDAP', whois: 'Registry WHOIS',
|
|
95
98
|
shop: 'Shop', list: 'Price list' })[raw?.source] ?? (confirmed ? 'Shop' : likely ? 'DNS' : 'Registry');
|
|
96
99
|
const shop = usd.shop ?? raw?.shop ?? shops[fallbackShop(ending)]?.name;
|
|
97
|
-
const eligible = canRecommend(ending,
|
|
100
|
+
const eligible = canRecommend(ending, eligibleList);
|
|
98
101
|
const shopUrl = shopSearchUrl(shopIds.get(shop) ?? fallbackShop(ending), domain);
|
|
99
102
|
const checkout = taken || reserved || !eligible ? null : [raw?.checkout, shopUrl].find(url => safeLink(url, domain)) ?? null;
|
|
100
|
-
return { domain, ending,
|
|
103
|
+
return { domain, ending, rank: qualityRank(domain, requested, eligibleList), state, status, ...usd, total,
|
|
104
|
+
shop, checkout, eligible, source, ...(raw?.savings && { savings: raw.savings }),
|
|
105
|
+
...(includePrice && dnsNeed(usd.shop) && { dns: dnsNeed(usd.shop) }),
|
|
101
106
|
priceLabel: usd.now != null || usd.renew != null ? (confirmed ? 'Shop quote' : taken ? 'Standard list price benchmark' : 'List price') : '',
|
|
102
107
|
checkedAt: raw?.checkedAt ?? data.checkedAt, priceAt: confirmed ? raw?.checkedAt ?? data.checkedAt : raw?.priceAt ?? data.priceListDate,
|
|
103
108
|
site: raw?.site ?? detail.details?.sites?.[ending] ?? row.details?.sites?.[ending] };
|
|
104
109
|
});
|
|
110
|
+
// Free rows first, then in the quality order (a typed exact domain is requested), then by upfront payment.
|
|
105
111
|
records.sort((a, b) => Number(b.state === 'free' || b.priceLabel === 'Shop quote')
|
|
106
|
-
- Number(a.state === 'free' || a.priceLabel === 'Shop quote')
|
|
112
|
+
- Number(a.state === 'free' || a.priceLabel === 'Shop quote')
|
|
113
|
+
|| a.rank - b.rank || (a.now ?? Infinity) - (b.now ?? Infinity));
|
|
107
114
|
return { row: { ...row, ...detail, name: row.name }, records };
|
|
108
115
|
});
|
|
109
116
|
}
|
|
@@ -118,7 +125,7 @@ function offerText(offer, linked = false) {
|
|
|
118
125
|
: renew != null ? cash(renew) + ' renewal' : 'price at shop';
|
|
119
126
|
return (linked && checkout ? '[' + domain + '](' + checkout + ')' : domain) + ' ' + price
|
|
120
127
|
+ (term > 1 ? ' every ' + term + ' years' : '') + (jump ? ' (renewal jumps)' : '')
|
|
121
|
-
+ (priceLabel ? ' ' + priceLabel.toLowerCase() + priceDate(offer) : '');
|
|
128
|
+
+ (priceLabel ? ' ' + priceLabel.toLowerCase() + priceDate(offer) : '') + (offer.dns ? ' (' + offer.dns.toLowerCase() + ')' : '');
|
|
122
129
|
}
|
|
123
130
|
|
|
124
131
|
function appFinding(value, row, source) {
|
|
@@ -143,10 +150,13 @@ function signals(group, triage = true) {
|
|
|
143
150
|
}
|
|
144
151
|
|
|
145
152
|
// One selection feeds the receipt lines and the share link: preferred endings, budget, eligibility, verdict and
|
|
146
|
-
// confirmed quotes decide the candidates
|
|
147
|
-
//
|
|
153
|
+
// confirmed quotes decide the candidates. Each name's pick follows the shared rule (choosePick): the highest-quality
|
|
154
|
+
// ending within $60 over 3 years (or the person's budget), else the least paid over 3 years; .ai only when asked for
|
|
155
|
+
// or within the budget. Cheapest is the lowest upfront payment and best value the least paid over 3 years, across
|
|
156
|
+
// every candidate in scope.
|
|
157
|
+
// names[i] is the same choice made inside groups[i] alone: its pick, its best value and its taken rows,
|
|
148
158
|
// preferred endings first in the user's order (.com first by default).
|
|
149
|
-
function receiptSelection(groups, args, triage) {
|
|
159
|
+
function receiptSelection(groups, args, triage, eligible = []) {
|
|
150
160
|
const preferred = args.endings ?? [];
|
|
151
161
|
const budget = args.budget;
|
|
152
162
|
const exact = !triage && groups.length === 1 && groups[0].row.name.includes('.');
|
|
@@ -155,14 +165,20 @@ function receiptSelection(groups, args, triage) {
|
|
|
155
165
|
// An exact lookup reports its one domain and never recommends.
|
|
156
166
|
const candidates = exact ? [] : groups.flatMap(group => group.row.verdict === 'Avoid' ? [] : group.records
|
|
157
167
|
.filter(record => inScope(record) && (record.state === 'free' || record.priceLabel === 'Shop quote'))
|
|
158
|
-
.map(record => ({ group, record })));
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
168
|
+
.map(record => ({ group, record, domain: record.domain, now: record.now ?? null, total: record.total ?? null })));
|
|
169
|
+
const context = group => ({ requested: group.row.name.includes('.') ? [...preferred, group.row.name] : preferred,
|
|
170
|
+
eligible, budget });
|
|
171
|
+
// Across names, every exact domain the person typed counts as asked for.
|
|
172
|
+
const across = { requested: [...preferred, ...groups.map(group => group.row.name).filter(name => name.includes('.'))], eligible, budget };
|
|
173
|
+
// Ties on price go to the better verdict, then the quality order.
|
|
174
|
+
const rank = item => (verdictOrder[item.group.row.verdict] ?? 0) * 1000 + item.record.rank;
|
|
175
|
+
const pickOf = group => choosePick(candidates.filter(item => item.group === group), context(group));
|
|
176
|
+
const valueOf = items => lowestTotal(items, rank);
|
|
177
|
+
const picks = groups.flatMap(group => {
|
|
178
|
+
const pick = pickOf(group);
|
|
179
|
+
return pick ? [pick] : [];
|
|
180
|
+
}).sort((a, b) => (verdictOrder[a.group.row.verdict] ?? 0) - (verdictOrder[b.group.row.verdict] ?? 0)
|
|
181
|
+
|| comparePicks(a, b, across) || a.record.domain.localeCompare(b.record.domain)).slice(0, 3);
|
|
166
182
|
const order = preferred.length ? preferred : ['com'];
|
|
167
183
|
const takenRank = record => {
|
|
168
184
|
const index = order.indexOf(record.ending);
|
|
@@ -170,13 +186,13 @@ function receiptSelection(groups, args, triage) {
|
|
|
170
186
|
};
|
|
171
187
|
return {
|
|
172
188
|
exact, preferred, budget,
|
|
173
|
-
best:
|
|
174
|
-
picks
|
|
175
|
-
cheapest: candidates
|
|
176
|
-
value:
|
|
189
|
+
best: picks[0],
|
|
190
|
+
picks,
|
|
191
|
+
cheapest: lowestUpfront(candidates, rank),
|
|
192
|
+
value: valueOf(candidates),
|
|
177
193
|
names: groups.map(group => {
|
|
178
194
|
const own = candidates.filter(item => item.group === group);
|
|
179
|
-
return { pick:
|
|
195
|
+
return { pick: pickOf(group)?.record ?? null, value: valueOf(own)?.record ?? null,
|
|
180
196
|
taken: group.records.filter(record => record.state === 'taken' && (!preferred.length || preferred.includes(record.ending)))
|
|
181
197
|
.sort((a, b) => takenRank(a) - takenRank(b)) };
|
|
182
198
|
}),
|
|
@@ -233,9 +249,11 @@ function summary(groups, args, triage, selection) {
|
|
|
233
249
|
handles && 'Handles for ' + evidenceText(wanted.row.name) + ': ' + plain(handles) + '.',
|
|
234
250
|
running.length ? 'Still checking ' + running.join(', ') + '. The results page updates by itself.' : null,
|
|
235
251
|
...offerLines,
|
|
236
|
-
|
|
237
|
-
'
|
|
238
|
-
|
|
252
|
+
// Cheapest upfront and best value over 3 years each get a line only when they are not the pick.
|
|
253
|
+
cheapest?.record !== best?.record || !best ? 'Cheapest: ' + (cheapest ? label(cheapest) : best ? 'needs a shop quote.' : 'none found in scope.') : null,
|
|
254
|
+
value?.record !== best?.record || !best ? 'Best value: ' + (value ? value.record.domain + ', ' + cash(value.record.total) + ' in payments due in 3 years'
|
|
255
|
+
+ ' (' + value.record.priceLabel.toLowerCase() + priceDate(value.record) + (value.record.jump ? ', renewal jumps' : '') + ')'
|
|
256
|
+
+ caution(value) : 'needs a shop quote') + '.' : null,
|
|
239
257
|
(args.purchase ? 'This check leaves checkout to you. ' : '') + next + eligibility,
|
|
240
258
|
];
|
|
241
259
|
// Savings are page-only proof for each pick: dated list prices from at least three shops, never a pitch.
|
|
@@ -394,7 +412,7 @@ const amountsFor = ({ now, renew }) => [cash(now) ?? 'No price', cash(renew) ??
|
|
|
394
412
|
|
|
395
413
|
function rowNote(row) {
|
|
396
414
|
return [row.status, row.priceLabel, row.term > 1 ? row.term + ' years per payment' : null,
|
|
397
|
-
row.jump ? 'Renewal jumps' : null, !row.eligible ? '.' + row.ending + ' needs ' + eligibilityNeed(row.ending) : null,
|
|
415
|
+
row.jump ? 'Renewal jumps' : null, row.dns ?? null, !row.eligible ? '.' + row.ending + ' needs ' + eligibilityNeed(row.ending) : null,
|
|
398
416
|
row.source, row.checkedAt, row.priceAt ? 'Price checked ' + row.priceAt : null].filter(Boolean).join(' · ');
|
|
399
417
|
}
|
|
400
418
|
|
|
@@ -553,8 +571,8 @@ export function resultPages({ env = process.env,
|
|
|
553
571
|
return (data, args, { triage = false, watch = false, reuse = null, refresh = false } = {}) => {
|
|
554
572
|
const work = writes.then(async () => {
|
|
555
573
|
const at = data.checkedAt ?? new Date().toISOString();
|
|
556
|
-
const groups = watch ? [] : resultGroups(data, args.eligible);
|
|
557
|
-
const selection = receiptSelection(groups, args, triage);
|
|
574
|
+
const groups = watch ? [] : resultGroups(data, args.eligible, args.endings);
|
|
575
|
+
const selection = receiptSelection(groups, args, triage, args.eligible ?? data.eligible ?? []);
|
|
558
576
|
const { lines, savings, shortLines } = watch ? { lines: data.say.split('\n'), savings: [] } : data.pending ? { lines: [
|
|
559
577
|
...(data.failed ? ['Some checks did not finish. Registry answers received are on the page.']
|
|
560
578
|
: ['Still checking trademark, app and web sources. Registry answers so far are on the page.', 'The results page updates by itself.']),
|
package/server.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
3
|
"name": "dev.domainhound/domain-hound",
|
|
4
|
-
"title": "Domain Hound",
|
|
5
|
-
"description": "
|
|
4
|
+
"title": "Domain Hound: Domains for agents",
|
|
5
|
+
"description": "One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track",
|
|
6
6
|
"websiteUrl": "https://domainhound.dev",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.8",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"registryType": "npm",
|
|
11
11
|
"identifier": "domain-hound",
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.8",
|
|
13
13
|
"transport": {
|
|
14
14
|
"type": "stdio"
|
|
15
15
|
}
|
package/server.mjs
CHANGED
|
@@ -10,6 +10,7 @@ import { attributed, errorText, progressText } from './display.mjs';
|
|
|
10
10
|
import { resultPages, resultsLine } from './results.mjs';
|
|
11
11
|
import { watchDomain, watchTool } from './watch.mjs';
|
|
12
12
|
import { domainDossier, dossierTool } from './dossier.mjs';
|
|
13
|
+
import { myDomains, portfolioTool } from './clis/portfolio/portfolio.mjs';
|
|
13
14
|
import { callPurchaseTool, purchaseToolNames, registeredTools, withCheckQuoteOffer, withWatchQuoteOffer } from './clis/spaceship/tools.mjs';
|
|
14
15
|
|
|
15
16
|
// The capability ships inside the package; tests inject another directory through serve({ cwd }).
|
|
@@ -34,7 +35,7 @@ const nameSchema = { type: 'string', minLength: 1, maxLength: 127, pattern: entr
|
|
|
34
35
|
const endingsSchema = {
|
|
35
36
|
type: 'array', minItems: 1, maxItems: supportedEndings.length, uniqueItems: true,
|
|
36
37
|
items: { type: 'string', enum: supportedEndings },
|
|
37
|
-
description: 'Endings to consider for the recommendation, in preference order. For .com only use ["com"]. The page still shows all
|
|
38
|
+
description: 'Endings to consider for the recommendation, in preference order; listed endings rank first. For .com only use ["com"]. The page still shows all twelve default endings for bare names. '
|
|
38
39
|
+ 'On request only (add them here when the person asks or names a country): ' + requestEndings.map(ending => '.' + ending).join(', ') + '.',
|
|
39
40
|
};
|
|
40
41
|
const countryEnding = {
|
|
@@ -51,16 +52,15 @@ const lookupProperties = {
|
|
|
51
52
|
ai: { type: 'boolean', description: 'Legacy option. .ai is now included by default.' },
|
|
52
53
|
endings: endingsSchema,
|
|
53
54
|
budget: { type: 'number', minimum: 0, maximum: 1000000,
|
|
54
|
-
description: '
|
|
55
|
+
description: 'The person\'s budget in USD, only when they gave one. Endings that cost more upfront are left out, and it replaces the $60 three-year cap of the default pick (highest-quality ending within the cap, else the least paid over 3 years; .ai only when asked for or within this budget). Carry it from the registry screen into triage.' },
|
|
55
56
|
eligible: { type: 'array', uniqueItems: true, items: { type: 'string', enum: restrictedEndings },
|
|
56
57
|
description: 'Restricted endings the buyer qualifies to register. Pass no or eu only when the buyer qualifies for that ending.' },
|
|
57
58
|
};
|
|
58
59
|
const relay = 'The answer starts with the clickable Markdown link on the first line of say. Then give the relevant facts from say.';
|
|
59
60
|
const checkTool = {
|
|
60
61
|
name: 'check_domains',
|
|
61
|
-
description: 'Check availability and dated
|
|
62
|
-
+ 'For
|
|
63
|
-
+ 'For a buy or register request, set purchase: true and state the checkout limitation. Set confirm: true only for an explicit live shop check. '
|
|
62
|
+
description: 'Check availability and dated prices for up to 20 names or domains. Use triage_names for product names. '
|
|
63
|
+
+ 'For purchase requests, set purchase: true and relay the checkout guidance. Use confirm: true only for an explicit live shop check. '
|
|
64
64
|
+ 'Keep list, shop-confirmed and premium prices distinct. ' + relay,
|
|
65
65
|
inputSchema: {
|
|
66
66
|
type: 'object',
|
|
@@ -85,10 +85,9 @@ const legacyTool = { ...checkTool, name: 'broker_find',
|
|
|
85
85
|
|
|
86
86
|
const triageTool = {
|
|
87
87
|
name: 'triage_names',
|
|
88
|
-
description: '
|
|
89
|
-
+ 'Call triage_names once with those names,
|
|
90
|
-
+ '
|
|
91
|
-
+ 'Use the returned verdicts. Report checks in progress as pending and give the page link. ' + relay,
|
|
88
|
+
description: 'Find or vet a product name before any other search. For naming, generate five distinct, easy-to-say names, with the supplied name first. '
|
|
89
|
+
+ 'Call triage_names once with those names, a short about description and shortlist: true. Checks domains, trademarks, apps, rivals and meanings. '
|
|
90
|
+
+ 'Use the returned verdicts and label unfinished checks as pending. ' + relay,
|
|
92
91
|
inputSchema: {
|
|
93
92
|
type: 'object',
|
|
94
93
|
properties: {
|
|
@@ -257,6 +256,9 @@ function triageArguments(args) {
|
|
|
257
256
|
throw new Error('names[' + bad + '] is not valid. Supply 1 to 20 bare names of up to 100 characters, without commas or domain endings.');
|
|
258
257
|
}
|
|
259
258
|
const flags = lookupFlags(args);
|
|
259
|
+
// Requested endings rank first in the screen's own picks, and a budget applies there as on the receipt.
|
|
260
|
+
if (args.endings) flags.push('--prefer-endings', args.endings.join(','));
|
|
261
|
+
if (args.budget !== undefined) flags.push('--upfront-cap', String(args.budget));
|
|
260
262
|
if (Object.hasOwn(args, 'shortlist') && typeof args.shortlist !== 'boolean') throw new Error('shortlist must be a boolean.');
|
|
261
263
|
const { companyType, additionalHandles } = args;
|
|
262
264
|
if (companyType !== undefined && !Object.hasOwn(handlePriorities, companyType)) throw new Error('Choose a supported company type.');
|
|
@@ -318,7 +320,7 @@ function readProgress(progress, line) {
|
|
|
318
320
|
// Start one capability run. It ends on its own; only the maximum lookup time or server shutdown stops it.
|
|
319
321
|
// A name screen answers first with the checks done so far ({"followUp":true} on its first line) and keeps running
|
|
320
322
|
// the slow checks; the re-assessed result on its next line resolves lookup.later (null when there is none).
|
|
321
|
-
function startLookup(args, cwd, maxMs) {
|
|
323
|
+
function startLookup(args, cwd, maxMs, onLookupEvent) {
|
|
322
324
|
const triage = args[0] === '--triage';
|
|
323
325
|
const lookup = { started: performance.now(), progress: { answers: new Map(), stage: null }, finished: false, exited: false,
|
|
324
326
|
collect: false, outcome: null };
|
|
@@ -358,7 +360,10 @@ function startLookup(args, cwd, maxMs) {
|
|
|
358
360
|
settle(() => parseOutput(firstLine, false, 0));
|
|
359
361
|
}
|
|
360
362
|
});
|
|
361
|
-
createInterface({ input: child.stderr, crlfDelay: Infinity }).on('line', line =>
|
|
363
|
+
createInterface({ input: child.stderr, crlfDelay: Infinity }).on('line', line => {
|
|
364
|
+
readProgress(lookup.progress, line);
|
|
365
|
+
onLookupEvent?.('progress', lookup.progress);
|
|
366
|
+
});
|
|
362
367
|
let stopped = false;
|
|
363
368
|
const limit = setTimeout(() => {
|
|
364
369
|
stopped = true;
|
|
@@ -383,7 +388,11 @@ function startLookup(args, cwd, maxMs) {
|
|
|
383
388
|
later(next);
|
|
384
389
|
};
|
|
385
390
|
child.once('error', () => finish(true));
|
|
386
|
-
child.once('close', code =>
|
|
391
|
+
child.once('close', code => {
|
|
392
|
+
finish(code !== 0);
|
|
393
|
+
onLookupEvent?.('exited');
|
|
394
|
+
});
|
|
395
|
+
onLookupEvent?.('started');
|
|
387
396
|
return lookup;
|
|
388
397
|
}
|
|
389
398
|
|
|
@@ -412,7 +421,8 @@ function pendingTriage(progress, rows) {
|
|
|
412
421
|
|
|
413
422
|
export async function serve({
|
|
414
423
|
input = process.stdin, output = process.stdout, cwd = capabilityDir, timeout = timeoutMs, maxLookup = maxLookupMs,
|
|
415
|
-
pages = resultPages(), watch = watchDomain, socialLookup = checkSocialHandles, dossier = domainDossier,
|
|
424
|
+
pages = resultPages(), watch = watchDomain, socialLookup = checkSocialHandles, dossier = domainDossier, portfolio = myDomains,
|
|
425
|
+
onLookupEvent,
|
|
416
426
|
} = {}) {
|
|
417
427
|
const send = response => output.write(JSON.stringify({ jsonrpc: '2.0', ...response }) + '\n');
|
|
418
428
|
const error = (id, code, message) => send({ id, error: { code, message } });
|
|
@@ -437,7 +447,7 @@ export async function serve({
|
|
|
437
447
|
const key = JSON.stringify([cliArgs, presentation]);
|
|
438
448
|
let lookup = lookups.get(key);
|
|
439
449
|
if (!lookup) {
|
|
440
|
-
lookup = startLookup(cliArgs, cwd, maxLookup);
|
|
450
|
+
lookup = startLookup(cliArgs, cwd, maxLookup, onLookupEvent);
|
|
441
451
|
lookups.set(key, lookup);
|
|
442
452
|
lookup.done.then(() => {
|
|
443
453
|
if (lookups.get(key) !== lookup) return;
|
|
@@ -613,7 +623,7 @@ export async function serve({
|
|
|
613
623
|
}
|
|
614
624
|
if (method !== 'tools/list' && method !== 'tools/call') return error(id, -32601, 'Method not found');
|
|
615
625
|
if (!initialized) return error(id, -32000, 'Domain Hound has not been initialized');
|
|
616
|
-
if (method === 'tools/list') return reply({ tools: registeredTools([checkTool, triageTool, namingTool, legacyTool, watchTool, dossierTool]) });
|
|
626
|
+
if (method === 'tools/list') return reply({ tools: registeredTools([checkTool, triageTool, namingTool, legacyTool, watchTool, dossierTool, portfolioTool]) });
|
|
617
627
|
const { name, arguments: args } = params ?? {};
|
|
618
628
|
if (purchaseToolNames.has(name)) return reply(await callPurchaseTool(name, args));
|
|
619
629
|
if (name === namingTool.name) {
|
|
@@ -642,6 +652,13 @@ export async function serve({
|
|
|
642
652
|
return reply(errorResult(problem.message));
|
|
643
653
|
}
|
|
644
654
|
}
|
|
655
|
+
if (name === portfolioTool.name) {
|
|
656
|
+
try {
|
|
657
|
+
return reply(toolResult(JSON.stringify(await portfolio(args))));
|
|
658
|
+
} catch (problem) {
|
|
659
|
+
return reply(errorResult(problem.message));
|
|
660
|
+
}
|
|
661
|
+
}
|
|
645
662
|
const purchase = isObject(args) && args.purchase === true;
|
|
646
663
|
if (name === triageTool.name) {
|
|
647
664
|
let current;
|
package/share.mjs
CHANGED
|
@@ -19,19 +19,21 @@ export function shareUrl(groups, checkedAt, facts = []) {
|
|
|
19
19
|
const base = records.length > 1 ? records[0].domain.split('.')[0] : '';
|
|
20
20
|
const endings = [];
|
|
21
21
|
let jumps = 0;
|
|
22
|
-
|
|
22
|
+
let cloudflare = 0;
|
|
23
|
+
for (const [position, { domain, status, now, renew, term, jump, dns }] of records.entries()) {
|
|
23
24
|
const state = shareStatuses.indexOf(status);
|
|
24
25
|
if (typeof domain !== 'string' || domain.length > 253 || !shareDomain.test(domain) || state < 0) return null;
|
|
25
26
|
const part = domain.startsWith(base + '.') ? domain.slice(base.length) : domain;
|
|
26
27
|
endings.push([part, state, cents(now), cents(renew), term ?? 1]);
|
|
27
28
|
if (jump) jumps += 2 ** position;
|
|
29
|
+
if (dns) cloudflare += 2 ** position;
|
|
28
30
|
}
|
|
29
31
|
const { pick, value, taken = records.filter(record => /^Taken\b/.test(record.status)) } = facts[index] ?? {};
|
|
30
32
|
const rowOf = record => records.indexOf(record);
|
|
31
33
|
const total = value && cents(value.total);
|
|
32
34
|
if ([pick, value, ...taken].some(record => record && rowOf(record) < 0) || (value && total === null)) return null;
|
|
33
35
|
const meta = { ...(pick && { p: rowOf(pick) }), ...(value && { b: [rowOf(value), total] }),
|
|
34
|
-
...(jumps && { j: jumps }), ...(taken.length && { t: taken.map(rowOf) }) };
|
|
36
|
+
...(jumps && { j: jumps }), ...(taken.length && { t: taken.map(rowOf) }), ...(cloudflare && { c: cloudflare }) };
|
|
35
37
|
const display = row.name.trim().normalize('NFC');
|
|
36
38
|
const name = shareName.test(display) ? display : records[0].domain;
|
|
37
39
|
shortlist.push([name, Math.max(0, shareVerdicts.indexOf(row.verdict)), base, endings,
|
package/site/r/share-format.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Version 2 stores a timestamp and up to five groups of [name, verdict, domain label, endings, facts?].
|
|
2
2
|
// A domain starts with a dot when it reuses the group's label. Prices are in integer cents.
|
|
3
3
|
// facts is optional and only holds what the local receipt worked out for that name:
|
|
4
|
-
// { p: pick row, b: [best value row, three-year payments in cents], j: renewal-jump bit mask by row, t: taken rows, preferred first
|
|
4
|
+
// { p: pick row, b: [best value row, three-year payments in cents], j: renewal-jump bit mask by row, t: taken rows, preferred first,
|
|
5
|
+
// c: bit mask of rows whose price needs Cloudflare DNS }. A link carries c only when such a row is shown.
|
|
5
6
|
// Version 1 links have no facts: they decode with no pick or best value and with jumps worked out from their prices.
|
|
6
7
|
export const sharePage = 'https://domainhound.dev/r/';
|
|
7
8
|
export const shareUrlLimit = 2000;
|
|
@@ -32,21 +33,24 @@ const maximumInflatedBytes = 24 * 1024;
|
|
|
32
33
|
const isCents = value => value === null || (Number.isSafeInteger(value) && value >= 0);
|
|
33
34
|
const dollars = value => value === null ? null : value / 100;
|
|
34
35
|
const isTaken = row => /^Taken\b/.test(row.status);
|
|
35
|
-
const factKeys = ['p', 'b', 'j', 't'];
|
|
36
|
+
const factKeys = ['p', 'b', 'j', 't', 'c'];
|
|
37
|
+
export const cloudflareDns = 'Needs Cloudflare DNS';
|
|
36
38
|
|
|
37
39
|
function parseFacts(facts, rows) {
|
|
38
40
|
if (!facts || typeof facts !== 'object' || Array.isArray(facts) || Object.keys(facts).some(key => !factKeys.includes(key))) return null;
|
|
39
|
-
const { p: pick = null, b: best = null, j: jumps = 0, t: taken = [] } = facts;
|
|
41
|
+
const { p: pick = null, b: best = null, j: jumps = 0, t: taken = [], c: cloudflare = 0 } = facts;
|
|
40
42
|
const validIndex = index => Number.isInteger(index) && index >= 0 && index < rows.length;
|
|
41
43
|
const available = index => validIndex(index) && ['Free at the registry', 'Confirmed at shop'].includes(rows[index].status);
|
|
42
44
|
if ((pick !== null && !available(pick))
|
|
43
45
|
|| (best !== null && !(Array.isArray(best) && best.length === 2 && available(best[0]) && best[1] !== null && isCents(best[1])))
|
|
44
46
|
|| !Number.isSafeInteger(jumps) || jumps < 0 || jumps >= 2 ** rows.length
|
|
47
|
+
|| !Number.isSafeInteger(cloudflare) || cloudflare < 0 || cloudflare >= 2 ** rows.length
|
|
45
48
|
|| !Array.isArray(taken) || new Set(taken).size !== taken.length
|
|
46
49
|
|| !taken.every(index => validIndex(index) && isTaken(rows[index]))) return null;
|
|
47
50
|
return {
|
|
48
51
|
records: rows.map((record, index) => ({ ...record, jump: Boolean(jumps & (1 << index)), pick: index === pick,
|
|
49
|
-
...(best?.[0] === index && { bestValue: dollars(best[1]) })
|
|
52
|
+
...(best?.[0] === index && { bestValue: dollars(best[1]) }),
|
|
53
|
+
...(Math.floor(cloudflare / 2 ** index) % 2 === 1 && { dns: cloudflareDns }) })),
|
|
50
54
|
takenDomains: taken.map(index => rows[index].domain),
|
|
51
55
|
};
|
|
52
56
|
}
|
package/watch.mjs
CHANGED
|
@@ -8,10 +8,10 @@ const consentTextVersion = 'news-v1';
|
|
|
8
8
|
|
|
9
9
|
export const watchTool = {
|
|
10
10
|
name: 'watch_domain',
|
|
11
|
-
description: 'Check
|
|
12
|
-
+ 'Use the email and optional name they gave for this submission. If the email is missing, ask once and never guess. '
|
|
11
|
+
description: 'Check registry, expiry and website. Start a free release watch only at the person’s request. '
|
|
12
|
+
+ 'Use only the email and optional name they gave for this submission. If the email is missing, ask once and never guess. '
|
|
13
13
|
+ 'Before submitting, ask exactly: “' + newsQuestion + '” Pass news: true only on an explicit yes, or false if they decline or skip it. '
|
|
14
|
-
+ '
|
|
14
|
+
+ 'Only the email confirmation can start news. Relay say as written.',
|
|
15
15
|
annotations: { title: 'Watch a domain', readOnlyHint: false, destructiveHint: false, openWorldHint: true },
|
|
16
16
|
inputSchema: {
|
|
17
17
|
type: 'object',
|