domain-hound 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/clis/domain-check/naming-method.mjs +3 -3
- package/hosted.mjs +13 -4
- package/package.json +2 -1
- package/plugin.json +1 -1
- package/results.mjs +31 -3
- package/server.json +2 -2
- package/server.mjs +113 -99
- package/short-answer.mjs +106 -0
- package/skills/naming/SKILL.md +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"plugins": [
|
|
6
6
|
{
|
|
7
7
|
"name": "domain-hound",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.15",
|
|
9
9
|
"source": "./",
|
|
10
10
|
"description": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track.",
|
|
11
11
|
"relevance": { "topic": "Domains", "signals": { "hosts": ["rdap.org", "porkbun.com"] } }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domain-hound",
|
|
3
3
|
"displayName": "Domain Hound",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.15",
|
|
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"
|
|
@@ -38,9 +38,9 @@ export const namingRecipe = (about = '') => 'Naming recipe (naming skill v1). En
|
|
|
38
38
|
+ '5. Screen: call triage_names ONCE with your best EIGHT, strongest first (the first five get marks, apps and rivals). '
|
|
39
39
|
+ 'Add about, geo from memory, any endings or budget, and candidates: per name recipe, relation (direct/loose/none), spellings, '
|
|
40
40
|
+ 'realWord, descriptive, misspelled, narrow, soundsLike, badMeaning, language. Missing evidence counts as not checked. Skip check_domains.\n'
|
|
41
|
-
+ '6. Answer:
|
|
42
|
-
+ 'fewer than
|
|
43
|
-
+ '
|
|
41
|
+
+ '6. Answer: Show the tool’s answer as given. Keep the results link. Offer details only if the user asks. '
|
|
42
|
+
+ 'If fewer than five pass, never pad. '
|
|
43
|
+
+ 'The results page updates as checks finish.\n'
|
|
44
44
|
+ '7. Steer: ask exactly "' + steeringQuestion + '" Find what the two loved names share and what the hated one signals; '
|
|
45
45
|
+ 'generate the next round that way. Never re-show a rejected name.\n'
|
|
46
46
|
+ 'Recipes (suggestive or arbitrary, never descriptive): odd pair (default), subject word + unexpected concrete word, Loomfox; '
|
package/hosted.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { normalizeName } from './clis/domain-check/name-search.mjs';
|
|
4
|
+
import { defaultEndings, normalizeName } from './clis/domain-check/name-search.mjs';
|
|
5
5
|
import { rdapSignal } from './clis/domain-check/registry.mjs';
|
|
6
6
|
import { searchApps } from './clis/domain-check/triage-sources.mjs';
|
|
7
7
|
|
|
@@ -200,7 +200,16 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
200
200
|
const [main, ...extras] = await Promise.all([get(name, signal),
|
|
201
201
|
...extraEndings.map(ending => get(normalizeName(name) + '.' + ending, signal))]);
|
|
202
202
|
const { details, ...answer } = main;
|
|
203
|
+
// The web view hides taken .inc rows. Verify it explicitly before reporting that all defaults are taken.
|
|
204
|
+
const missingInc = !main.query.exactDomain && !extraEndings.includes('inc') && main.domains.length === defaultEndings.length - 1
|
|
205
|
+
&& defaultEndings.filter(ending => ending !== 'inc').every(ending =>
|
|
206
|
+
main.domains.some(row => row.ending === ending && row.status === 'taken'));
|
|
203
207
|
answer.domains = [...main.domains, ...extras.flatMap(extra => extra.domains)];
|
|
208
|
+
const inc = { domain: main.query.ascii + '.inc', ending: 'inc', status: 'unknown', prices: [] };
|
|
209
|
+
const withInc = row => ({ domains: [...answer.domains, row], choice: answer.choice });
|
|
210
|
+
const comparison = missingInc ? get(inc.domain, signal)
|
|
211
|
+
.then(extra => withInc(extra.domains.find(row => row.domain === inc.domain) ?? inc), () => withInc(inc)) : null;
|
|
212
|
+
if (comparison) answer[alternativeEndings] = withInc(inc);
|
|
204
213
|
answer.complete = main.complete && extras.every(extra => extra.complete);
|
|
205
214
|
const exact = main.query.exactDomain;
|
|
206
215
|
const needsAlternatives = exact && main.domains.length === 1 && main.domains[0].domain === exact && main.domains[0].status === 'taken';
|
|
@@ -226,9 +235,9 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
226
235
|
: detailsApp.then(row => definite(initialApp) ? initialApp
|
|
227
236
|
: recoverApple(best(initialApp, row), main.query.name, signal));
|
|
228
237
|
const waitingForApple = !definite(initialApp) && Boolean(initialApp || hasDetails);
|
|
229
|
-
if (hasDetails || waitingForApple) {
|
|
238
|
+
if (hasDetails || waitingForApple || alternatives || comparison) {
|
|
230
239
|
onDomains?.(waitingForApple ? { ...answer, appStore: { ...initialApp, status: 'pending' } } : answer,
|
|
231
|
-
waitingForApple ? appCheck : undefined);
|
|
240
|
+
waitingForApple ? appCheck : undefined, alternatives ?? comparison);
|
|
232
241
|
}
|
|
233
242
|
|
|
234
243
|
const nameChecks = await detailCheck;
|
|
@@ -241,7 +250,7 @@ export function hostedClient(version, { env = process.env, fetchFn = fetch, appl
|
|
|
241
250
|
if (nameChecks && appStore) nameChecks.appStore = appStore;
|
|
242
251
|
const googlePlay = best(answer.googlePlay, nameChecks?.googlePlay);
|
|
243
252
|
const mark = best(answer.trademarks?.us, nameChecks?.trademarks?.us);
|
|
244
|
-
return { ...answer, ...(
|
|
253
|
+
return { ...answer, ...((alternatives || comparison) && { [alternativeEndings]: await (alternatives ?? comparison) }), nameChecks,
|
|
245
254
|
...(appStore && { appStore }), ...(googlePlay && { googlePlay }), ...(mark && { trademarks: { us: mark } }) };
|
|
246
255
|
},
|
|
247
256
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "domain-hound",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"hosted.mjs",
|
|
44
44
|
"hosted-results.mjs",
|
|
45
45
|
"display.mjs",
|
|
46
|
+
"short-answer.mjs",
|
|
46
47
|
"results.mjs",
|
|
47
48
|
"results-style.mjs",
|
|
48
49
|
"results-cards.mjs",
|
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.15",
|
|
5
5
|
"description": "Domains for agents. One MCP for everything domains: find, check, buy, set up, watch, move, renew, keep track.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Lars Hvinden"
|
package/results.mjs
CHANGED
|
@@ -234,7 +234,7 @@ function receiptSelection(groups, args, triage, eligible = [], local = false) {
|
|
|
234
234
|
function checkedOption(record) {
|
|
235
235
|
const term = record.term ?? 1;
|
|
236
236
|
return { domain: record.domain, shop: record.shop, firstYearUsd: record.now == null ? null : record.now / term,
|
|
237
|
-
renewalUsd: record.renew == null ? null : record.renew / term, firstPaymentUsd: record.now, threeYearUsd: record.total,
|
|
237
|
+
renewalUsd: record.renew == null ? null : record.renew / term, renewalPaymentUsd: record.renew, firstPaymentUsd: record.now, threeYearUsd: record.total,
|
|
238
238
|
minimumYears: term, buyUrl: record.checkout, needsCloudflareDns: Boolean(record.dns) };
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -244,6 +244,33 @@ function localExactPick(records, args, exactDomain) {
|
|
|
244
244
|
})), { ...args, endings: [exactDomain] });
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
+
// Presentation-only rows use the same prices and picks as the saved receipt.
|
|
248
|
+
export const shortPresentation = Symbol('short presentation');
|
|
249
|
+
|
|
250
|
+
function localPresentation(groups, selection, args) {
|
|
251
|
+
return groups.map(({ row, records }, index) => {
|
|
252
|
+
const exactDomain = row.name.includes('.') ? row.name : null;
|
|
253
|
+
const pick = exactDomain ? localExactPick(records, args, exactDomain)
|
|
254
|
+
: selection.names[index]?.pick && checkedOption(selection.names[index].pick);
|
|
255
|
+
const domains = records.map(record => ({
|
|
256
|
+
domain: record.domain, ending: record.ending,
|
|
257
|
+
status: record.state === 'free' || record.state === 'taken' ? (record.state === 'free' ? 'available' : 'taken') : 'unknown',
|
|
258
|
+
reason: record.status === 'Not offered for registration' ? 'reserved' : null,
|
|
259
|
+
prices: record.now == null ? [] : [checkedOption(record)],
|
|
260
|
+
}));
|
|
261
|
+
const source = (key, name) => {
|
|
262
|
+
const answer = row.competition?.[key];
|
|
263
|
+
return { status: waitingOn(row, name) ? 'pending' : answer == null ? 'unknown'
|
|
264
|
+
: Array.isArray(answer) && !answer.length ? 'no_match_found' : 'taken' };
|
|
265
|
+
};
|
|
266
|
+
const marks = officeMarks(row).filter(mark => mark.office === 'US' && mark.live && mark.tier === 'Exact')
|
|
267
|
+
.map(mark => ({ ...mark, status: /register/i.test(mark.status) ? 'registered' : /appl|pending/i.test(mark.status) ? 'applied' : null }));
|
|
268
|
+
return { query: { name: row.name, exactDomain }, domains, choice: { pick },
|
|
269
|
+
appStore: source('AppStore', 'App Store'), googlePlay: source('GooglePlay', 'Google Play'),
|
|
270
|
+
trademarks: { us: { marks, status: marks.length ? 'exact_match_found' : waitingOn(row, 'USPTO') ? 'pending' : 'unknown' } } };
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
247
274
|
function localCheckSummary(group, args, selection, priceListDate) {
|
|
248
275
|
const { row, records } = group;
|
|
249
276
|
const exactDomain = row.name.includes('.') ? row.name : null;
|
|
@@ -733,7 +760,8 @@ export function resultPages({ env = process.env,
|
|
|
733
760
|
const { hosted, lines, ...structured } = data;
|
|
734
761
|
return { display: say, say, ...structured, resultPage: url };
|
|
735
762
|
}
|
|
736
|
-
|
|
763
|
+
const short = watch ? undefined : localPresentation(groups, selection, args);
|
|
764
|
+
if (triage && args.shortlist) return { [shortPresentation]: short, display: say, say, ...(local && { source: 'local' }), checkedAt: at, resultPage: url };
|
|
737
765
|
const { receiptDetails, say: priorSay, display: priorDisplay, ...structured } = data;
|
|
738
766
|
if (triage && receiptDetails) structured.names = structured.names.map((row, index) => ({
|
|
739
767
|
...row, ...(receiptDetails[index]?.score && { score: receiptDetails[index].score }),
|
|
@@ -742,7 +770,7 @@ export function resultPages({ env = process.env,
|
|
|
742
770
|
if (!watch && !triage) structured.names = structured.names.map((row, index) => ({
|
|
743
771
|
...row, ...(groups[index].row.score && { score: groups[index].row.score }),
|
|
744
772
|
}));
|
|
745
|
-
return { display: say, say, ...structured, checkedAt: at, resultPage: url };
|
|
773
|
+
return { [shortPresentation]: short, display: say, say, ...structured, checkedAt: at, resultPage: url };
|
|
746
774
|
});
|
|
747
775
|
writes = work.catch(() => {});
|
|
748
776
|
return work;
|
package/server.json
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
"title": "Domain Hound: Domains for agents",
|
|
5
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.15",
|
|
8
8
|
"packages": [
|
|
9
9
|
{
|
|
10
10
|
"registryType": "npm",
|
|
11
11
|
"identifier": "domain-hound",
|
|
12
|
-
"version": "0.1.
|
|
12
|
+
"version": "0.1.15",
|
|
13
13
|
"transport": {
|
|
14
14
|
"type": "stdio"
|
|
15
15
|
}
|
package/server.mjs
CHANGED
|
@@ -6,16 +6,17 @@ import { createInterface } from 'node:readline';
|
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
7
|
import { checkSocialHandles, handlePriorities, pendingHandleRows, requestPlatforms } from './clis/domain-check/handles.mjs';
|
|
8
8
|
import { progressPrefix } from './clis/domain-check/progress.mjs';
|
|
9
|
-
import { attributed, errorText, localCheckNotice, md, progressText
|
|
10
|
-
import { resultPages, resultsLine } from './results.mjs';
|
|
9
|
+
import { attributed, errorText, localCheckNotice, md, progressText } from './display.mjs';
|
|
10
|
+
import { resultPages, resultsLine, shortPresentation } from './results.mjs';
|
|
11
11
|
import { watchDomain, watchTool } from './watch.mjs';
|
|
12
12
|
import { domainDossier, dossierTool } from './dossier.mjs';
|
|
13
13
|
import { myDomains, portfolioTool } from './clis/portfolio/portfolio.mjs';
|
|
14
|
-
import { callPurchaseTool, purchaseToolNames, registeredTools,
|
|
14
|
+
import { callPurchaseTool, purchaseToolNames, registeredTools, withCheckQuoteOffer, withWatchQuoteOffer } from './clis/spaceship/tools.mjs';
|
|
15
15
|
import { candidateFields, compactScore, compareScores, scoreEligible, scoreHandles, scoreName, validCandidate } from './clis/domain-check/name-score.mjs';
|
|
16
16
|
import { scoreLogger } from './clis/domain-check/score-log.mjs';
|
|
17
|
-
import { HostedRateLimit, hostedClient, hostedDebug } from './hosted.mjs';
|
|
18
|
-
import { generatedChecks, hostedChecks,
|
|
17
|
+
import { alternativeEndings, HostedRateLimit, hostedClient, hostedDebug } from './hosted.mjs';
|
|
18
|
+
import { checkLines, generatedChecks, hostedChecks, hostedResult, visibleChecks } from './hosted-results.mjs';
|
|
19
|
+
import { shortDomainAnswer, shortIdeaAnswer } from './short-answer.mjs';
|
|
19
20
|
|
|
20
21
|
// The capability ships inside the package; tests inject another directory through serve({ cwd }).
|
|
21
22
|
export const capabilityDir = fileURLToPath(new URL('./clis/domain-check/', import.meta.url));
|
|
@@ -63,9 +64,12 @@ const lookupProperties = {
|
|
|
63
64
|
};
|
|
64
65
|
const searchAnnotations = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true };
|
|
65
66
|
const batchResultMeta = { 'anthropic/maxResultSizeChars': 40_000 };
|
|
67
|
+
const showAnswer = 'Show the answer as given; offer details only if the user asks.';
|
|
68
|
+
const detailSchema = { type: 'string', enum: ['short', 'full'],
|
|
69
|
+
description: 'Choose how much to show, e.g. "full" for all shops and handles.' };
|
|
66
70
|
const serverInstructions = 'Use Domain Hound for domains and product, company or app names, including availability, registration and renewal prices, trademarks, buying and watches. '
|
|
67
71
|
+ 'Start with check_domains for availability or prices, triage_names for naming or trademark screening, and watch_domain for a release watch. '
|
|
68
|
-
+ 'Include the clickable Results page link whenever one is returned
|
|
72
|
+
+ showAnswer + ' Include the clickable Results page link whenever one is returned. '
|
|
69
73
|
+ 'To buy, set purchase: true on check_domains, then use quote_domain, buy_domain after approval, and setup_domain with verify: true. '
|
|
70
74
|
+ 'Use my_domains to review renewals of domains the person already owns.';
|
|
71
75
|
|
|
@@ -74,13 +78,14 @@ const checkTool = {
|
|
|
74
78
|
description: 'Use this when checking whether a name or exact domain is available, what an ending such as .ai costs, or where to register. '
|
|
75
79
|
+ 'Use query for one exact domain or bare name ({"query":"lanternbay.dev"}), or names for a batch ({"names":["lanternbay.dev","lanternbay"]}). '
|
|
76
80
|
+ 'Use purchase: true to start a purchase and confirm: true only for an explicit live shop check. '
|
|
77
|
-
+ '
|
|
81
|
+
+ 'Checks domains, app names and exact US trademark matches. Repeat to collect pending checks. Use triage_names for name ideas and quote_domain for a live Spaceship purchase quote. ' + showAnswer,
|
|
78
82
|
annotations: { title: 'Check domain availability and prices', ...searchAnnotations },
|
|
79
83
|
_meta: batchResultMeta,
|
|
80
84
|
inputSchema: {
|
|
81
85
|
type: 'object',
|
|
82
86
|
properties: {
|
|
83
87
|
...lookupProperties,
|
|
88
|
+
detail: detailSchema,
|
|
84
89
|
query: { ...nameSchema,
|
|
85
90
|
description: 'One name or exact domain, e.g. "lanternbay.me" or "lanternbay". Supply either query or names.' },
|
|
86
91
|
names: { type: 'array', minItems: 1, maxItems: 20,
|
|
@@ -113,8 +118,7 @@ const triageTool = {
|
|
|
113
118
|
name: 'triage_names',
|
|
114
119
|
description: 'Use this when naming a product, company or app, or checking existing names for trademarks, competing apps and handles. '
|
|
115
120
|
+ 'Pass idea to use the website’s name generator ({"idea":"A room booking app"}) or names to screen candidates ({"names":["Quiet Otter"]}). '
|
|
116
|
-
+ '
|
|
117
|
-
+ 'For a domain-only lookup or registrar prices, use check_domains.',
|
|
121
|
+
+ 'Repeat with the same input to collect pending checks. For a domain-only lookup or registrar prices, use check_domains. ' + showAnswer,
|
|
118
122
|
annotations: { title: 'Find and screen product names', ...searchAnnotations, idempotentHint: false },
|
|
119
123
|
_meta: batchResultMeta,
|
|
120
124
|
inputSchema: {
|
|
@@ -127,6 +131,7 @@ const triageTool = {
|
|
|
127
131
|
description: 'Names rejected last round, e.g. ["Hush Room"].' },
|
|
128
132
|
round: { type: 'integer', minimum: 1, maximum: 20, description: 'Naming round, e.g. 2.' },
|
|
129
133
|
...lookupProperties,
|
|
134
|
+
detail: detailSchema,
|
|
130
135
|
names: { type: 'array', minItems: 1, maxItems: 20, items: { type: 'string', minLength: 1, maxLength: 100 },
|
|
131
136
|
description: '1 to 20 bare names without endings, e.g. ["Quiet Otter","Hush Room"].' },
|
|
132
137
|
shortlist: { type: 'boolean', description: 'Set true for a short naming shortlist.' },
|
|
@@ -166,18 +171,17 @@ const namingTool = {
|
|
|
166
171
|
};
|
|
167
172
|
|
|
168
173
|
const isObject = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
169
|
-
// The
|
|
174
|
+
// The legacy display stays in structured results. Lookup tools can supply their own text.
|
|
170
175
|
function toolResult(json, isError = false) {
|
|
171
176
|
const structured = JSON.parse(json);
|
|
172
177
|
return { content: [{ type: 'text', text: structured.display }], structuredContent: structured, isError };
|
|
173
178
|
}
|
|
174
179
|
const errorResult = message => toolResult(errorText(message), true);
|
|
175
180
|
|
|
176
|
-
//
|
|
177
|
-
// needed to decide, without repeating the display or attaching the raw evidence to the MCP response.
|
|
181
|
+
// Keep the existing compact structured response, including the complete batch status list.
|
|
178
182
|
function compactCheckResult(result) {
|
|
179
183
|
if (result.isError) return result;
|
|
180
|
-
const { names,
|
|
184
|
+
const { names, resultPage, pending } = result.structuredContent;
|
|
181
185
|
const rows = (names ?? []).map(({ name, free, taken, reserved, resale, likely_free, likely_taken, shop_check, checking }) => {
|
|
182
186
|
const statuses = [
|
|
183
187
|
['available', free?.filter(row => row.s !== 'prem' && !row.prem).map(row => row.d)],
|
|
@@ -192,69 +196,60 @@ function compactCheckResult(result) {
|
|
|
192
196
|
...(resultPage && { resultPage }), ...(pending && { pending }),
|
|
193
197
|
...(rows.length && { rows }),
|
|
194
198
|
};
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
const pageAndIntro = intro && [pageLink, ...intro].join('\n') + '\n';
|
|
209
|
-
const withStatuses = pageAndIntro && display.startsWith(pageAndIntro)
|
|
210
|
-
? [...intro, pageLink, ...statusLines, display.slice(pageAndIntro.length)].join('\n')
|
|
211
|
-
: display.replace(pageLink, [pageLink, ...statusLines].join('\n'));
|
|
212
|
-
const fits = value => {
|
|
213
|
-
const wire = JSON.stringify({ content: [{ type: 'text', text: value }], structuredContent, isError: false });
|
|
214
|
-
return rows.length <= 1 ? Buffer.byteLength(wire) < 8_000 : wire.length < 40_000;
|
|
215
|
-
};
|
|
216
|
-
if (rows.length <= 1 && fits(withStatuses)) {
|
|
217
|
-
text = withStatuses;
|
|
218
|
-
} else {
|
|
219
|
-
const prices = names.map((row, index) => {
|
|
220
|
-
const offers = checks
|
|
221
|
-
? checks[index].domains.filter(domain => domain.status === 'available').flatMap(domain => {
|
|
222
|
-
const [offer] = domain.prices;
|
|
223
|
-
if (!offer) return [];
|
|
224
|
-
const term = offer.minimumYears ?? 1;
|
|
225
|
-
return [{ d: domain.ending, shop: offer.shop, now: offer.firstPaymentUsd ?? offer.firstYearUsd * term,
|
|
226
|
-
renew: offer.renewalPaymentUsd ?? offer.renewalUsd * term, y3: offer.threeYearUsd, term }];
|
|
227
|
-
})
|
|
228
|
-
: (row.free ?? []).filter(offer => offer.s !== 'prem' && !offer.prem).map(offer => ({
|
|
229
|
-
...listPrices?.[offer.d], ...offer,
|
|
230
|
-
}));
|
|
231
|
-
const list = offers.filter(({ now }) => Number.isFinite(now)).map(({ d, shop, now, renew, y3, term, s }) =>
|
|
232
|
-
'.' + md(d) + (shop ? ' ' + md(shop) : '') + ' $' + now.toFixed(2) + '/'
|
|
233
|
-
+ (Number.isFinite(renew) ? '$' + renew.toFixed(2) : 'unknown') + (term > 1 ? ' (' + term + 'y term)' : '')
|
|
234
|
-
+ (Number.isFinite(y3) ? ', $' + y3.toFixed(2) + ' over 3y' : '') + (s === 'ok' ? ' confirmed' : ''));
|
|
235
|
-
return { name: md(row.name), list };
|
|
236
|
-
});
|
|
237
|
-
const notes = [
|
|
238
|
-
...(pending ? ['Name checks are still running. Call the same tool with the same input to collect them.'] : []),
|
|
239
|
-
...(complete === false && !pending ? ['Some checks are incomplete. Confirm uncertain endings at a shop.'] : []),
|
|
240
|
-
...(quoteOffer ? [quoteOfferLine(names[0].name)] : []),
|
|
241
|
-
tail,
|
|
242
|
-
];
|
|
243
|
-
const highlights = display.split('\n')
|
|
244
|
-
.filter(line => /^(?:US trademark warning for |The Hound’s pick is |Cheapest: |Best value: )/.test(line)).slice(0, 8);
|
|
245
|
-
const intro = checks?.flatMap(check => hostedIntroLines(check, pending, 1, false)) ?? [];
|
|
246
|
-
const priceHeader = 'USD before tax, upfront/renewal per term, list prices' + (date ? ' from ' + date : '') + ' unless marked confirmed.';
|
|
247
|
-
const render = (offerLimit, highlights) => {
|
|
248
|
-
const priceLines = prices.filter(({ list }) => list.length).map(({ name, list }) => name + ' · ' + list.slice(0, offerLimit).join(', '));
|
|
249
|
-
return attributed([...intro, ...lead, ...statusLines, '', ...(priceLines.length ? [priceHeader, ...priceLines, ''] : []),
|
|
250
|
-
...(checks ? [] : highlights), ...notes].join('\n'), purchase);
|
|
251
|
-
};
|
|
252
|
-
text = render(Infinity, highlights);
|
|
253
|
-
if (!fits(text)) text = render(Infinity, []);
|
|
254
|
-
if (!fits(text)) text = render(1, []);
|
|
255
|
-
}
|
|
199
|
+
return { ...result, structuredContent };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function lookupResult(page, args, triage = false) {
|
|
203
|
+
const result = toolResult(JSON.stringify(page));
|
|
204
|
+
if (args.detail === 'full' || args.additionalHandles?.length) {
|
|
205
|
+
const alternatives = triage ? [] : (page.checks ?? []).flatMap(check => {
|
|
206
|
+
const options = check.query.exactDomain && check[alternativeEndings];
|
|
207
|
+
return options ? checkLines({ ...options, domains: options.domains.filter(row => row.domain !== check.query.exactDomain) },
|
|
208
|
+
page.pending, { local: true }) : [];
|
|
209
|
+
});
|
|
210
|
+
if (alternatives.length) result.content[0].text += '\n\nOther endings\n' + alternatives.join('\n');
|
|
211
|
+
return result;
|
|
256
212
|
}
|
|
257
|
-
|
|
213
|
+
const link = page.resultPage && resultsLine(page.resultPage).replace(/^Results page:/, 'All prices, shops and handles:');
|
|
214
|
+
if (!page.checks && page.pending && page.names?.length) {
|
|
215
|
+
const progressRows = (triage ? page.names.slice(0, 5) : page.names).map(({ name, free, taken, premium }) => {
|
|
216
|
+
const show = values => values.map(value => {
|
|
217
|
+
const ending = value.d ?? value;
|
|
218
|
+
return ending === name ? ending : '.' + ending;
|
|
219
|
+
}).join(' ');
|
|
220
|
+
const available = (free ?? []).filter(value => value.s !== 'prem');
|
|
221
|
+
const extras = premium ?? free?.filter(value => value.s === 'prem');
|
|
222
|
+
const verdict = [
|
|
223
|
+
available.length ? 'available ' + show(available) : '',
|
|
224
|
+
taken?.length ? 'taken ' + show(taken) : '',
|
|
225
|
+
extras?.length ? 'premium ' + show(extras) : '',
|
|
226
|
+
].filter(Boolean).join(' · ');
|
|
227
|
+
return md(name) + (verdict ? (triage ? ' - ' : ': ') + verdict : '');
|
|
228
|
+
});
|
|
229
|
+
result.content[0].text = [...progressRows, 'Still checking ' + (triage ? 'names and domains.' : 'domains.'),
|
|
230
|
+
args.purchase && !triage ? 'This check leaves checkout to you.' : '', link].filter(Boolean).join('\n');
|
|
231
|
+
return result;
|
|
232
|
+
}
|
|
233
|
+
if (!page.resultPage) return result;
|
|
234
|
+
const local = page[shortPresentation];
|
|
235
|
+
const checks = page.checks ?? local;
|
|
236
|
+
if (!checks) return result;
|
|
237
|
+
|
|
238
|
+
const options = { pending: Boolean(page.generation && page.pending), link };
|
|
239
|
+
const short = triage
|
|
240
|
+
? shortIdeaAnswer(visibleChecks(checks, args, page.generation), options)
|
|
241
|
+
: checks.map(check => shortDomainAnswer({ ...check, alternatives: check[alternativeEndings] }, {
|
|
242
|
+
...options, link: checks.length === 1 ? link : undefined,
|
|
243
|
+
})).join('\n\n');
|
|
244
|
+
const notes = [
|
|
245
|
+
...(args.purchase && !triage ? [page.quoteOffer ? 'Ask for a live Spaceship quote.' : 'This check leaves checkout to you.'] : []),
|
|
246
|
+
...(local && !triage ? [localCheckNotice] : []),
|
|
247
|
+
];
|
|
248
|
+
const text = triage ? short : [
|
|
249
|
+
short.replace(/^[^\n]+/, first => [first, ...notes].join(' ')),
|
|
250
|
+
...(checks.length !== 1 ? [link] : []),
|
|
251
|
+
].join('\n');
|
|
252
|
+
return { ...result, content: [{ type: 'text', text }] };
|
|
258
253
|
}
|
|
259
254
|
|
|
260
255
|
function localProgress(json) {
|
|
@@ -332,6 +327,7 @@ function cliArguments(args) {
|
|
|
332
327
|
if (!isObject(args) || Object.keys(args).some(key => !Object.hasOwn(checkTool.inputSchema.properties, key))) {
|
|
333
328
|
throw new Error('Supply an object with query or names.');
|
|
334
329
|
}
|
|
330
|
+
validateDetail(args);
|
|
335
331
|
const flags = lookupFlags(args);
|
|
336
332
|
if (args.endings) flags.push('--prefer-endings', args.endings.join(','));
|
|
337
333
|
if (args.budget !== undefined) flags.push('--upfront-cap', String(args.budget));
|
|
@@ -408,6 +404,7 @@ function triageArguments(args) {
|
|
|
408
404
|
if (bad >= 0) {
|
|
409
405
|
throw new Error('names[' + bad + '] is not valid. Supply 1 to 20 bare names of up to 100 characters, without commas or domain endings.');
|
|
410
406
|
}
|
|
407
|
+
validateDetail(args);
|
|
411
408
|
const flags = lookupFlags(args);
|
|
412
409
|
// Requested endings rank first in the screen's own picks, and a budget applies there as on the receipt.
|
|
413
410
|
if (args.endings) flags.push('--prefer-endings', args.endings.join(','));
|
|
@@ -437,8 +434,13 @@ function triageArguments(args) {
|
|
|
437
434
|
return ['--triage', args.names.join(','), '--compact', '--receipt', ...flags];
|
|
438
435
|
}
|
|
439
436
|
|
|
437
|
+
function validateDetail(args) {
|
|
438
|
+
if (Object.hasOwn(args, 'detail') && !detailSchema.enum.includes(args.detail)) throw new Error('Choose short or full detail.');
|
|
439
|
+
}
|
|
440
|
+
|
|
440
441
|
function generationArguments(args) {
|
|
441
|
-
|
|
442
|
+
validateDetail(args);
|
|
443
|
+
if (Object.keys(args).some(key => !['idea', 'wanted', 'avoid', 'round', 'detail'].includes(key))) {
|
|
442
444
|
throw new Error('Supply idea and optional wanted, avoid and round.');
|
|
443
445
|
}
|
|
444
446
|
const { idea, wanted, avoid, round } = args;
|
|
@@ -607,7 +609,7 @@ export async function serve({
|
|
|
607
609
|
|
|
608
610
|
// Join the running or finished lookup for the same input, or start one. Answer within the budget with the
|
|
609
611
|
// result, or with the progress so far while the lookup keeps running for a repeated call to collect.
|
|
610
|
-
async function runLookup(args, buildArgs, rowsFor, render, renderProgress, onLookup = () => {}, started = performance.now()) {
|
|
612
|
+
async function runLookup(args, buildArgs, rowsFor, render, renderProgress, onLookup = () => {}, started = performance.now(), legacy = false) {
|
|
611
613
|
let cliArgs;
|
|
612
614
|
let rows;
|
|
613
615
|
try {
|
|
@@ -636,8 +638,9 @@ export async function serve({
|
|
|
636
638
|
if (!await within(lookup, timeout - (performance.now() - started))) {
|
|
637
639
|
lookup.collect = true;
|
|
638
640
|
try {
|
|
639
|
-
|
|
640
|
-
rows, elapsedMs: performance.now() - lookup.started, budgetMs: timeout }, lookup)
|
|
641
|
+
const snapshot = await renderProgress(lookup.progress, {
|
|
642
|
+
rows, elapsedMs: performance.now() - lookup.started, budgetMs: timeout }, lookup);
|
|
643
|
+
return legacy ? toolResult(snapshot) : lookupResult(JSON.parse(snapshot), args, buildArgs === triageArguments);
|
|
641
644
|
} catch {
|
|
642
645
|
return errorResult('Domain Hound could not format the progress.');
|
|
643
646
|
}
|
|
@@ -647,7 +650,8 @@ export async function serve({
|
|
|
647
650
|
return errorResult(lookup.outcome.error);
|
|
648
651
|
}
|
|
649
652
|
try {
|
|
650
|
-
|
|
653
|
+
const page = await render(lookup.outcome.data, lookup);
|
|
654
|
+
return legacy ? toolResult(JSON.stringify(page)) : lookupResult(page, args, buildArgs === triageArguments);
|
|
651
655
|
} catch {
|
|
652
656
|
return errorResult('Domain Hound could not format the result.');
|
|
653
657
|
}
|
|
@@ -668,7 +672,8 @@ export async function serve({
|
|
|
668
672
|
} catch (problem) {
|
|
669
673
|
return errorResult(problem.message);
|
|
670
674
|
}
|
|
671
|
-
const
|
|
675
|
+
const { detail, ...lookupArgs } = args;
|
|
676
|
+
const key = JSON.stringify([triage, streamDomains, Object.entries(lookupArgs).sort(([a], [b]) => a.localeCompare(b))]);
|
|
672
677
|
let lookup = hostedLookups.get(key);
|
|
673
678
|
const repeat = Boolean(lookup);
|
|
674
679
|
if (!lookup) {
|
|
@@ -677,32 +682,33 @@ export async function serve({
|
|
|
677
682
|
const signal = AbortSignal.any([controller.signal, hostedShutdown.signal, AbortSignal.timeout(hostedLookupMs)]);
|
|
678
683
|
const job = { result: null, first: null };
|
|
679
684
|
const early = new Array(rows.length);
|
|
680
|
-
const
|
|
685
|
+
const firstChecks = [];
|
|
681
686
|
let received = 0;
|
|
682
687
|
let canStream = false;
|
|
683
688
|
let ready;
|
|
684
689
|
job.ready = new Promise(resolve => { ready = resolve; });
|
|
685
|
-
const receive = (answer, index, qualifies = false, apple) => {
|
|
690
|
+
const receive = (answer, index, qualifies = false, apple, alternatives) => {
|
|
686
691
|
if (!streamDomains || early[index]) return;
|
|
687
|
-
early[index] = answer;
|
|
688
|
-
if (apple)
|
|
692
|
+
early[index] = { ...answer };
|
|
693
|
+
if (apple) firstChecks.push(apple.then(appStore => { if (appStore) early[index].appStore = appStore; }));
|
|
694
|
+
if (alternatives) firstChecks.push(alternatives.then(comparison => { early[index][alternativeEndings] = comparison; }));
|
|
689
695
|
received += 1;
|
|
690
696
|
if (qualifies) canStream = true;
|
|
691
697
|
if (received === rows.length && canStream) {
|
|
692
698
|
// Keep the domain answer available at the deadline, even while Apple's retry runs in the background.
|
|
693
|
-
job.first = within({ done: Promise.all(
|
|
694
|
-
.then(() => renderHostedLookup(
|
|
699
|
+
job.first = within({ done: Promise.all(firstChecks) }, Math.min(timeout, hostedFirstAnswerMs) - (performance.now() - started))
|
|
700
|
+
.then(() => renderHostedLookup(early.map(answer => ({ ...answer })), lookupArgs, triage, { pending: true }));
|
|
695
701
|
ready();
|
|
696
702
|
}
|
|
697
703
|
};
|
|
698
704
|
job.done = Promise.all(rows.map(async ({ name }, index) => {
|
|
699
705
|
const answer = await hosted.check(name, name.includes('.') ? [] : extra, signal,
|
|
700
|
-
streamDomains ? (value, apple) => receive(value, index, true, apple) : undefined);
|
|
706
|
+
streamDomains ? (value, apple, alternatives) => receive(value, index, true, apple, alternatives) : undefined);
|
|
701
707
|
receive(answer, index);
|
|
702
708
|
return answer;
|
|
703
709
|
})).then(async answers => {
|
|
704
710
|
const first = await job.first;
|
|
705
|
-
return renderHostedLookup(answers,
|
|
711
|
+
return renderHostedLookup(answers, lookupArgs, triage, { reuse: first?.resultPage });
|
|
706
712
|
}, problem => {
|
|
707
713
|
if (problem instanceof HostedRateLimit) return errorResult('The Hound needs a breather. Try again in a few minutes.');
|
|
708
714
|
hostedDebug('Hosted domain lookup could not finish; using the local check.');
|
|
@@ -716,14 +722,21 @@ export async function serve({
|
|
|
716
722
|
lookup = job;
|
|
717
723
|
hostedLookups.set(key, job);
|
|
718
724
|
}
|
|
719
|
-
const ready = repeat ? lookup.done : lookup.ready;
|
|
725
|
+
const ready = repeat || detail === 'full' ? lookup.done : lookup.ready;
|
|
720
726
|
if (!await within({ done: ready }, timeout - (performance.now() - started))) {
|
|
721
|
-
if (lookup.first)
|
|
727
|
+
if (lookup.first && streamDomains && !repeat) {
|
|
728
|
+
const page = await lookup.first;
|
|
729
|
+
if (page) return lookupResult(page, args);
|
|
730
|
+
}
|
|
722
731
|
hostedDebug('Hosted check exceeded the tool response budget; it is still running.');
|
|
723
|
-
|
|
732
|
+
const result = toolResult(JSON.stringify({ display: attributed('The hosted check is still running. Call the same tool again with the same input to collect it.'),
|
|
724
733
|
complete: false, pending: true }));
|
|
734
|
+
if (detail !== 'full' && (triage || streamDomains)) result.content[0].text = 'Still checking ' + (triage ? 'names and domains.' : 'domains.');
|
|
735
|
+
return result;
|
|
725
736
|
}
|
|
726
|
-
|
|
737
|
+
const page = lookup.finished ? lookup.result : await lookup.first;
|
|
738
|
+
if (!page || page.isError) return page;
|
|
739
|
+
return triage || streamDomains ? lookupResult(page, args, triage) : toolResult(JSON.stringify(page));
|
|
727
740
|
}
|
|
728
741
|
|
|
729
742
|
async function renderHostedLookup(checks, args, triage, { pending = false, reuse } = {}) {
|
|
@@ -737,13 +750,13 @@ export async function serve({
|
|
|
737
750
|
label: query.ascii, name: query.name, score,
|
|
738
751
|
}))));
|
|
739
752
|
}
|
|
740
|
-
return
|
|
753
|
+
return triage ? page : withCheckQuoteOffer(page, args);
|
|
741
754
|
} catch {
|
|
742
755
|
return errorResult('Domain Hound could not format the result.');
|
|
743
756
|
}
|
|
744
757
|
}
|
|
745
758
|
|
|
746
|
-
async function generateNames(args) {
|
|
759
|
+
async function generateNames(args, started) {
|
|
747
760
|
let input;
|
|
748
761
|
try {
|
|
749
762
|
input = generationArguments(args);
|
|
@@ -767,7 +780,7 @@ export async function serve({
|
|
|
767
780
|
const initial = await hosted.generate(input, AbortSignal.timeout(Math.max(1, Math.floor(timeout - 750))));
|
|
768
781
|
const pending = initial.stage === 'initial' && typeof initial.details?.id === 'string';
|
|
769
782
|
await write(initial, pending);
|
|
770
|
-
if (pending) track(hosted.finishGeneration(initial).then(final => write(final), () => write(initial, false, true)));
|
|
783
|
+
if (pending) job.finish = track(hosted.finishGeneration(initial).then(final => write(final), () => write(initial, false, true)));
|
|
771
784
|
})();
|
|
772
785
|
job.initial.then(() => {
|
|
773
786
|
setTimeout(() => { if (generations.get(key) === job) generations.delete(key); }, keepFinishedMs).unref();
|
|
@@ -775,7 +788,8 @@ export async function serve({
|
|
|
775
788
|
}
|
|
776
789
|
try {
|
|
777
790
|
await job.initial;
|
|
778
|
-
|
|
791
|
+
if (args.detail === 'full' && job.finish) await within({ done: job.finish }, timeout - (performance.now() - started));
|
|
792
|
+
return lookupResult(job.page, args, true);
|
|
779
793
|
} catch (problem) {
|
|
780
794
|
return problem instanceof HostedRateLimit
|
|
781
795
|
? errorResult('The Hound needs a breather. Try again in a few minutes.') : local();
|
|
@@ -997,7 +1011,7 @@ export async function serve({
|
|
|
997
1011
|
const purchase = isObject(args) && args.purchase === true;
|
|
998
1012
|
const started = performance.now();
|
|
999
1013
|
if (name === triageTool.name) {
|
|
1000
|
-
if (isObject(args) && Object.hasOwn(args, 'idea')) return reply(await generateNames(args));
|
|
1014
|
+
if (isObject(args) && Object.hasOwn(args, 'idea')) return reply(await generateNames(args, started));
|
|
1001
1015
|
const fromHost = await hostedLookup(args, true, started);
|
|
1002
1016
|
if (fromHost) return reply(fromHost);
|
|
1003
1017
|
let current;
|
|
@@ -1026,7 +1040,7 @@ export async function serve({
|
|
|
1026
1040
|
const exact = isObject(args) && typeof args.query === 'string' && args.query.includes('.');
|
|
1027
1041
|
const result = await hostedLookup(args, false, started, name === checkTool.name) ?? await runLookup(
|
|
1028
1042
|
args, cliArguments, checkRows, data => pages({ ...data, source: 'local' }, args).then(page => withCheckQuoteOffer(page, args)),
|
|
1029
|
-
(progress, timing) => localProgress(progressText(progress, { ...timing, purchase: purchase || exact })), undefined, started,
|
|
1043
|
+
(progress, timing) => localProgress(progressText(progress, { ...timing, purchase: purchase || exact })), undefined, started, name !== checkTool.name,
|
|
1030
1044
|
);
|
|
1031
1045
|
if (exact && args.picked === true && !result.isError && result.structuredContent?.resultPage) {
|
|
1032
1046
|
track(scoreLog?.picked(args.query, 'check_domains'));
|
package/short-answer.mjs
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
const plain = value => String(value ?? '').replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu, ' ').trim();
|
|
2
|
+
const usd = value => '$' + value.toFixed(2);
|
|
3
|
+
const taken = row => ['taken', 'exact_match_found'].includes(row?.status);
|
|
4
|
+
const free = row => ['not-found', 'no_match_found'].includes(row?.status);
|
|
5
|
+
|
|
6
|
+
function price(offer) {
|
|
7
|
+
const term = offer?.minimumYears ?? 1;
|
|
8
|
+
const now = offer?.firstPaymentUsd ?? offer?.firstYearUsd;
|
|
9
|
+
const renew = term > 1 ? offer?.renewalPaymentUsd : offer?.renewalUsd;
|
|
10
|
+
if (!Number.isFinite(now) || !Number.isFinite(renew) || !offer.shop) return '';
|
|
11
|
+
return usd(now) + ' now' + (term > 1 ? ' for ' + term + ' years' : '') + ', then ' + usd(renew)
|
|
12
|
+
+ (term > 1 ? ' every ' + term + ' years' : '/yr') + ' (' + plain(offer.shop) + ')'
|
|
13
|
+
+ (offer.needsCloudflareDns ? ' · requires Cloudflare DNS' : '');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function domainPrice(row, pick) {
|
|
17
|
+
const offer = pick?.domain === row.domain ? pick : row.prices?.[0];
|
|
18
|
+
return price(offer) || price(row.prices?.find(candidate => candidate.shop === offer?.shop));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function trademark(us) {
|
|
22
|
+
if (us?.status !== 'exact_match_found') return '';
|
|
23
|
+
const match = us.marks?.[0];
|
|
24
|
+
if (!match?.mark) return 'An exact US trademark match was found.';
|
|
25
|
+
const subject = plain(match.mark);
|
|
26
|
+
const owner = match.owner ? ' (' + plain(match.owner) + ')' : '';
|
|
27
|
+
const status = match.status === 'registered' ? ' is a US trademark' : match.status === 'applied'
|
|
28
|
+
? ' has a pending US trademark application' : ' has an exact US trademark match';
|
|
29
|
+
return subject + status + owner + '. Matters if you sell in the US.';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function appChecks(check, pending) {
|
|
33
|
+
const { nameChecks } = check;
|
|
34
|
+
const app = check.appStore ?? nameChecks?.appStore;
|
|
35
|
+
const play = check.googlePlay ?? nameChecks?.googlePlay;
|
|
36
|
+
const us = check.trademarks?.us ?? nameChecks?.trademarks?.us;
|
|
37
|
+
const sources = [['App Store', app], ['Google Play', play]];
|
|
38
|
+
const waiting = row => row?.status === 'pending' || (!row && pending);
|
|
39
|
+
const late = [...sources, ['US trademark', us]].filter(([, row]) => waiting(row)).map(([label]) => label);
|
|
40
|
+
const ready = sources.filter(([, row]) => !waiting(row));
|
|
41
|
+
const apps = ready.map(([label, row]) => label + ': '
|
|
42
|
+
+ (taken(row) ? 'taken' : free(row) ? 'no app with this name' : 'couldn’t check')).join(' · ');
|
|
43
|
+
return { apps, late, ready, warning: trademark(us) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function shortDomainAnswer(check, { pending, link } = {}) {
|
|
47
|
+
const exact = check.query.exactDomain;
|
|
48
|
+
const alternatives = check.alternatives;
|
|
49
|
+
const rows = alternatives?.domains ?? check.domains;
|
|
50
|
+
const available = rows.filter(row => row.status === 'available');
|
|
51
|
+
const pick = alternatives?.choice?.pick ?? check.choice?.pick;
|
|
52
|
+
const best = available.find(row => row.domain === pick?.domain) ?? available[0];
|
|
53
|
+
const hit = check.domains.find(row => row.domain === exact);
|
|
54
|
+
const primary = exact && hit?.status === 'available' ? hit : best;
|
|
55
|
+
const priced = primary && domainPrice(primary, pick);
|
|
56
|
+
const takenEnds = rows.filter(row => row.status === 'taken').map(row => '.' + row.ending);
|
|
57
|
+
const unknown = rows.filter(row => row.status === 'unknown' && row.reason !== 'reserved').map(row => '.' + row.ending);
|
|
58
|
+
let first;
|
|
59
|
+
if (exact) {
|
|
60
|
+
if (hit?.status === 'available') first = exact + ' is available' + (priced ? ': ' + priced : '') + '.';
|
|
61
|
+
else if (hit?.status === 'taken') first = exact + ' is taken.' + (best
|
|
62
|
+
? ' Best available: ' + best.domain + (priced ? ', ' + priced : '') + '.' : '');
|
|
63
|
+
else first = hit?.reason === 'reserved' ? exact + ' is reserved by the registry.' : 'Could not confirm ' + exact + '.';
|
|
64
|
+
} else if (best) {
|
|
65
|
+
first = best.domain + (best.domain === pick?.domain ? ' is your best bet' : ' is available') + (priced ? ': ' + priced : '') + '.';
|
|
66
|
+
} else if (rows.length && takenEnds.length === rows.length) {
|
|
67
|
+
first = 'All ' + rows.length + (rows.length === 1 ? ' ending is' : ' endings are') + ' taken. Want new name ideas?';
|
|
68
|
+
} else {
|
|
69
|
+
first = 'No available endings confirmed for ' + plain(check.query.name) + '.';
|
|
70
|
+
}
|
|
71
|
+
const also = available.filter(row => row !== primary).map(row => row.domain);
|
|
72
|
+
const endings = [
|
|
73
|
+
...(also.length ? ['Also available: ' + also.join(', ')] : []),
|
|
74
|
+
...(takenEnds.length && ((exact && alternatives) || (!exact && takenEnds.length < rows.length))
|
|
75
|
+
? ['Taken: ' + takenEnds.join(' ')] : []),
|
|
76
|
+
];
|
|
77
|
+
if (!exact && unknown.length) {
|
|
78
|
+
const note = 'Couldn’t confirm: ' + unknown.join(' ');
|
|
79
|
+
if (endings.length) endings[endings.length - 1] += ' · ' + note;
|
|
80
|
+
else endings.push(note);
|
|
81
|
+
}
|
|
82
|
+
const { apps, late, warning } = appChecks(check, pending);
|
|
83
|
+
if ([apps, late.length, warning].filter(Boolean).length === 3 && link && endings.length === 2) {
|
|
84
|
+
endings.splice(0, 2, endings.join(' · '));
|
|
85
|
+
}
|
|
86
|
+
return [first, ...endings, apps, warning && 'Heads-up: ' + warning,
|
|
87
|
+
late.length ? 'Still checking ' + late.join(', ') + '.' : '', link].filter(Boolean).join('\n');
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function shortIdeaAnswer(checks, { pending, link } = {}) {
|
|
91
|
+
const lines = checks.slice(0, 5).map(check => {
|
|
92
|
+
const pick = check.choice?.pick;
|
|
93
|
+
const row = check.domains.find(row => row.domain === pick?.domain && row.status === 'available');
|
|
94
|
+
const { ready, late, warning } = appChecks(check, pending);
|
|
95
|
+
const apps = ready.length === 2 && ready.every(([, answer]) => free(answer)) ? 'apps free'
|
|
96
|
+
: ready.length === 2 && ready.every(([, answer]) => taken(answer)) ? 'apps taken'
|
|
97
|
+
: ready.map(([label, answer]) => label + ' ' + (taken(answer) ? 'taken' : free(answer) ? 'free' : 'couldn’t check')).join(' · ');
|
|
98
|
+
const offer = row && domainPrice(row, pick);
|
|
99
|
+
return plain(check.query.name) + ' - ' + [
|
|
100
|
+
row ? row.domain + (offer ? ', ' + offer : '') : 'no domain pick',
|
|
101
|
+
apps, warning && 'Heads-up: ' + warning, late.length ? 'still checking ' + late.join(', ') : '',
|
|
102
|
+
].filter(Boolean).join(' · ');
|
|
103
|
+
});
|
|
104
|
+
return [...(lines.length ? lines : [pending ? 'Still checking names and domains.' : 'No names passed the checks.']),
|
|
105
|
+
link].filter(Boolean).join('\n');
|
|
106
|
+
}
|
package/skills/naming/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ The same method as Domain Hound's `naming_guide` tool. English names unless aske
|
|
|
15
15
|
4. **Generate.** 150 names per round, 25 per territory, mixing every recipe below. No judging yet. Every name contains or puns on a subject word.
|
|
16
16
|
5. **Filter before checking.** Drop hard bans, names over 12 letters or 3 syllables, names with more than one plausible spelling when heard, names that are hard to say aloud, and near-twins. Keep about 40.
|
|
17
17
|
6. **Check and score.** Call the Domain Hound `triage_names` tool once with your best eight, strongest first, a short `about`, and `candidates` evidence for each name (recipe, relation, spellings, realWord, descriptive, misspelled, narrow, soundsLike, badMeaning, language). It checks domains, trademarks, rivals, apps, handles and bad meanings, runs the bans in code, and returns a Name score v1 per name. Missing evidence and failed checks read "not checked", never clear. Repeat in batches for more names.
|
|
18
|
-
7. **Show.**
|
|
18
|
+
7. **Show.** Show the tool’s answer as given, including the results link. Offer details only if the user asks. If fewer than five names pass, never pad the list.
|
|
19
19
|
8. **Steer.** Ask the steering question. Work out what the two loved names share (recipe, territory, sound, length) and what the hated one signals. Run a new round of 150 in that direction. Never re-show a rejected name.
|
|
20
20
|
|
|
21
21
|
## Recipes
|