domain-hound 0.1.13 → 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.
@@ -4,7 +4,7 @@
4
4
  "plugins": [
5
5
  {
6
6
  "name": "domain-hound",
7
- "version": "0.1.13",
7
+ "version": "0.1.15",
8
8
  "source": { "source": "local", "path": "./" },
9
9
  "policy": { "installation": "AVAILABLE", "authentication": "ON_INSTALL" },
10
10
  "category": "Productivity"
@@ -5,7 +5,7 @@
5
5
  "plugins": [
6
6
  {
7
7
  "name": "domain-hound",
8
- "version": "0.1.13",
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.13",
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/assets/icon.svg CHANGED
@@ -1,7 +1,7 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120">
2
2
  <title>Snarl</title>
3
- <path fill="#f4c64f" stroke="#05070d" stroke-width="4" stroke-linejoin="round" d="M5 79Q8 62 13 44Q15 29 29 23Q42 13 58 16L71 19L79 18L84 24L79 26L86 32L95 33L101 37L112 37Q118 38 117 46L112 56L103 58L97 67L87 61L77 59L66 64L76 70L86 76L99 77L105 71L105 82Q101 91 91 92Q80 93 69 86L55 75L49 74Q43 89 30 97Q20 105 13 102Q6 100 7 89Z"/>
4
- <g fill="#05070d">
3
+ <path fill="#9fdcb6" stroke="#0f2e24" stroke-width="4" stroke-linejoin="round" d="M5 79Q8 62 13 44Q15 29 29 23Q42 13 58 16L71 19L79 18L84 24L79 26L86 32L95 33L101 37L112 37Q118 38 117 46L112 56L103 58L97 67L87 61L77 59L66 64L76 70L86 76L99 77L105 71L105 82Q101 91 91 92Q80 93 69 86L55 75L49 74Q43 89 30 97Q20 105 13 102Q6 100 7 89Z"/>
4
+ <g fill="#0f2e24">
5
5
  <path d="M8 87Q13 67 21 48Q27 32 39 28Q30 37 26 53Q20 74 8 94Z"/>
6
6
  <path d="M18 99Q30 90 36 72Q41 56 39 43Q48 50 44 67Q40 88 25 98Z"/>
7
7
  <path d="M45 23Q56 18 71 23L59 23L52 26Z"/>
@@ -10,5 +10,5 @@
10
10
  <path d="M98 45L104 40L116 40Q118 45 111 52L102 53Z"/>
11
11
  <path d="M46 59Q53 61 59 57L71 50Q79 45 88 48L97 53L108 53L103 58L98 62L88 57Q78 51 73 56L65 62L63 67L76 75Q84 82 97 80Q88 88 77 82L61 70Z"/>
12
12
  </g>
13
- <path fill="#f4c64f" d="M59 40L71 36L67 41L62 42ZM77 54L84 54L80 62ZM87 55L97 58L89 72L89 64ZM99 58L104 56L100 64Z"/>
13
+ <path fill="#9fdcb6" d="M59 40L71 36L67 41L62 42ZM77 54L84 54L80 62ZM87 55L97 58L89 72L89 64ZM99 58L104 56L100 64Z"/>
14
14
  </svg>
@@ -1,16 +1,21 @@
1
- /* Result styles vendored from lars-hv/domainhound-site at
2
- 2eee4e38864ad0870cfe317c5b5ca6307fd44bd4. Keep these excerpts in site order. */
1
+ /* Saved result styles from lars-hv/domainhound-site at
2
+ 1c35a8258e5d7fd94c951afcb775baf473126a5e (palette.css, site.css, brand-b.css and search.css). */
3
3
  :root {
4
4
  color-scheme: light;
5
- --ink: #100e08;
6
- --cream: #fff7de;
7
- --gold: #f4c64f;
5
+ --pine: #0f2e24;
6
+ --forest: #194e3b;
7
+ --leaf: #9fdcb6;
8
+ --mint: #cdebd6;
9
+ --mist: #eef7f0;
10
+ --paper: #f8fbf7;
11
+ --amber: #ead29d;
12
+ --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
8
13
  --gutter: clamp(18px, 4.5vw, 64px);
9
- --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
14
+ --body-size: 1.0625rem;
10
15
  }
11
16
  *, *::after, *::before { box-sizing: border-box; }
12
17
  [hidden] { display: none !important; }
13
- body { margin: 0; color: var(--ink); background: var(--cream); font: 600 1rem/1.45 Mulish, Arial, sans-serif; }
18
+ body { margin: 0; color: var(--pine); background: var(--paper); font: 600 1rem/1.45 Mulish, Arial, sans-serif; }
14
19
  h1, h2, h3, p, dl, dd, ul { margin: 0; }
15
20
  h1, h2, h3, .number, .result > strong { font-weight: 1000; line-height: .99; letter-spacing: -.04em; }
16
21
  h2 { font-size: clamp(2.5rem, 5.4vw, 5.8rem); }
@@ -28,25 +33,20 @@ button { cursor: pointer; }
28
33
  .brand { gap: 8px; min-height: 44px; font-weight: 1000; text-decoration: none; }
29
34
  .action { display: inline-block; min-height: 44px; padding: 9px 21px; font-weight: 950; font-size: .98rem; line-height: 1.3; }
30
35
  .action:hover { text-decoration: underline; text-underline-offset: .18em; }
31
- :root {
32
- --blue: #102385;
33
- --ink: var(--blue);
34
- --lime: #cdf473;
35
- --coral: #ffab91;
36
- --body-size: 1.0625rem;
37
- }
38
36
  body { font-size: var(--body-size); line-height: 1.5; }
39
- .mast, .hero, .trust, footer { background: var(--blue); color: var(--cream); }
37
+ .mast, footer { background: var(--forest); color: var(--paper); }
40
38
  .mast .brand { font: 700 .9rem var(--mono); }
41
39
  .mast-inner { min-height: 52px; }
42
40
  .mast nav a, .foot a { font-size: .9375rem; }
43
41
  .action {
44
- background: var(--lime); color: var(--blue); border: 2px solid var(--blue);
42
+ background: var(--leaf); color: var(--pine); border: 2px solid var(--pine);
45
43
  border-radius: 999px; font-size: var(--body-size); line-height: 1.45;
46
44
  }
47
45
  .hunt-results {
48
- background: var(--cream);
49
- color: var(--blue);
46
+ --blue: var(--pine);
47
+ --cream: var(--paper);
48
+ background: var(--mist);
49
+ color: var(--pine);
50
50
  padding-block: clamp(26px, 4vw, 56px);
51
51
  }
52
52
  .hunt-results h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
@@ -64,7 +64,6 @@ body { font-size: var(--body-size); line-height: 1.5; }
64
64
  .results-head { margin-bottom: 12px; }
65
65
  .results-head:has(.requested-actions) { justify-content: flex-start; align-items: baseline; }
66
66
  .hunt-card > .alternatives-title { display: block; margin: 16px 0 8px; }
67
- .alternatives-title + .trademark-slot:not(:empty) { margin-bottom: 8px; }
68
67
  .hunt-list { margin: 16px 0 0; list-style: none; padding: 0; display: grid; gap: 22px; }
69
68
  .hunt-card + .hunt-card { margin-top: 24px; }
70
69
  .hunt-list .hunt-card { border-top: 2px solid; padding-top: 12px; }
@@ -72,44 +71,44 @@ body { font-size: var(--body-size); line-height: 1.5; }
72
71
  .name-score, .offer-count, .detail-checks h5 { font: 750 .82rem/1.5 var(--mono); }
73
72
  .name-score { white-space: nowrap; }
74
73
  .offer-count { margin: 12px 0 6px; }
75
- .trademark-warning { border-left: 4px solid; background: var(--coral); padding: 12px 16px; }
74
+ .trademark-warning { border-left: 4px solid; background: var(--amber); padding: 12px 16px; }
76
75
  .trademark-warning strong { font-size: 1.15rem; }
77
76
  .trademark-warning p, .trademark-pending { font-size: .93rem; }
78
77
  .trademark-pending { border-left: 2px solid; padding-left: 10px; }
79
- .primary-checks { width: 100%; margin: 12px 0; font-size: .93rem; }
80
- .primary-checks > p { padding: 4px 0; border-top: 1px solid #10238540; }
78
+ .primary-checks:not(:empty) { margin: 12px 0; }
81
79
  .ending-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 2px; background: var(--blue); }
82
80
  .offer-row, .detail-checks { min-width: 0; background: var(--cream); padding: 15px 16px 0; }
83
81
  .offer-row { display: flex; flex-direction: column; align-items: flex-start; }
84
82
  .offer-head { width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 4px 10px; flex-wrap: wrap; }
85
83
  .domain-title { margin: 0; font: 750 clamp(1.1rem, 1.75vw, 1.42rem)/1.2 var(--mono); letter-spacing: -.05em; }
86
- .verdict, .lowest { background: var(--lime); padding: 1px 5px; font-weight: 850; }
84
+ .verdict, .lowest { background: var(--leaf); padding: 1px 5px; font-weight: 850; }
85
+ .lowest { background: var(--mint); }
87
86
  .verdict { font-size: .75rem; }
88
87
  .pick-label { margin-top: 3px; font-size: .8rem; }
89
88
  .first-price { margin-top: 10px; }
90
89
  .first-price strong { font: 950 1.75rem/1 Mulish, sans-serif; letter-spacing: -.055em; }
91
90
  .first-price, .renewal, .three-year, .taken-group, .suggestion-foot { font-size: .91rem; }
92
91
  .offer-row > .action { padding: 5px 14px; min-height: 34px; margin-top: 10px; text-decoration: none; background: transparent; font-size: .9rem; }
93
- .offer-row > .action:hover { background: var(--lime); }
92
+ .offer-row > .action:hover { background: var(--leaf); }
94
93
  .offer-condition, .renewal-warning { margin: 5px 0; font-size: .82rem; }
95
94
  .shop-table { width: 100%; margin: 12px 0 4px; border-collapse: collapse; font-size: .83rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
96
- .shop-table td, .shop-table th { text-align: right; padding: 6px 0 6px 4px; border-top: 1px solid #10238540; }
95
+ .shop-table td, .shop-table th { text-align: right; padding: 6px 0 6px 4px; border-top: 1px solid var(--mint); }
97
96
  .shop-table thead th { border-top: 1px solid; font-weight: 800; }
98
97
  .shop-table th:first-child { text-align: left; padding-left: 0; }
99
98
  .shop-table tbody small { display: block; width: fit-content; margin-top: 2px; font-size: .7rem; font-weight: 650; }
100
99
  .shop-table tbody small.lowest { font-weight: 850; }
101
- .renewal-warning { border-left: 2px solid var(--coral); padding-left: 8px; }
100
+ .renewal-warning { border-left: 2px solid var(--amber); padding-left: 8px; }
102
101
  .checks-toggle, .more-shops { color: inherit; background: none; border: 0; cursor: pointer; font: 850 .9rem/1.4 Mulish, sans-serif; }
103
102
  .checks-toggle { width: 100%; min-height: 44px; margin-top: auto; padding: 8px 0; text-align: left; border-top: 1px solid; }
104
103
  .checks-toggle::after { content: '+'; float: right; }
105
104
  .checks-toggle[aria-expanded=true]::after { content: '−'; }
106
105
  .more-shops { padding: 5px 0; text-decoration: underline; }
107
- .detail-checks { border: 2px solid var(--blue); border-top: 0; padding-bottom: 15px; }
106
+ .detail-checks { border: 2px solid var(--pine); border-top: 0; padding-bottom: 15px; }
108
107
  .detail-checks h4 { font-size: 1.12rem; margin: 0 0 8px; }
109
108
  .detail-checks h5 { margin: 0 0 5px; }
110
109
  .check-grid, .handle-list { display: grid; gap: 10px; }
111
110
  .handle-list { gap: 0; }
112
- .check-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid #10238540; font-size: .88rem; }
111
+ .check-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px solid var(--mint); font-size: .88rem; }
113
112
  .check-line a { text-align: right; font-weight: 650; }
114
113
  .mark-result:not(:empty) { margin-top: 8px; font-weight: 800; font-size: .9rem; }
115
114
  .taken-group { margin-top: 14px; }
@@ -121,7 +120,7 @@ body { font-size: var(--body-size); line-height: 1.5; }
121
120
  .refine, .recovery:not([hidden]) { margin-top: 20px; }
122
121
  .recovery > h3 { font-size: 1.6rem; }
123
122
  .result-sharing { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 20px; }
124
- .result-sharing:has(a), .result-sharing:has(.quote-caption:not(:empty)) { margin-top: 16px; padding-top: 10px; border-top: 1px solid #10238540; }
123
+ .result-sharing:has(a), .result-sharing:has(.quote-caption:not(:empty)) { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--mint); }
125
124
  .quote-caption, .result-sharing a { font-size: .8rem; }
126
125
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
127
126
  @media (min-width: 760px) {
@@ -135,7 +134,7 @@ body { font-size: var(--body-size); line-height: 1.5; }
135
134
  #result-pages > .hunt-card .check-grid { grid-template-columns: 1fr 2fr; gap: 28px; }
136
135
  #result-pages > .hunt-card .handle-list { grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 20px; }
137
136
  .ending-list { background: transparent; padding: 0; gap: 0; }
138
- .ending-list > * { border: 1px solid var(--blue); }
137
+ .ending-list > * { border: 1px solid var(--pine); }
139
138
  }
140
139
  /* Standalone receipts have one checks panel per name and native disclosure controls. */
141
140
  .hunt-results h1 { margin: 0; max-width: none; font-size: clamp(2rem, 4vw, 3.5rem); }
@@ -165,12 +164,14 @@ body { font-size: var(--body-size); line-height: 1.5; }
165
164
  .result-sharing { margin-block: 12px; }
166
165
  #result-pages > .hunt-card { margin-top: 12px; }
167
166
  footer { padding-block: 14px; font-size: .85rem; }
167
+ .primary-checks { width: 100%; font-size: .93rem; }
168
+ .primary-checks > p { padding-block: 4px; border-top: 1px solid var(--mint); }
169
+
168
170
  @media (prefers-color-scheme: dark) {
169
- :root { color-scheme: dark; --cream: #18203b; --blue: #f3edda; --ink: var(--blue); }
170
- .mast, footer { background: #101630; color: var(--blue); }
171
- .trademark-warning { background: #522f3a; border-color: var(--coral); }
172
- .verdict, .lowest, .offer-row > .action:hover { color: #102385; }
173
- .offer-row > .action { color: var(--blue); }
174
- .offer-row > .action:hover { color: #102385; }
175
- .shop-table td, .shop-table th, .result-sharing, .check-line { border-top-color: #838ca7; }
171
+ :root { color-scheme: dark; }
172
+ body, .hunt-results { background: var(--pine); color: var(--paper); }
173
+ .hunt-results { --blue: var(--leaf); --cream: var(--forest); }
174
+ .verdict, .lowest, .trademark-warning, .offer-row > .action:hover { color: var(--pine); }
175
+ .offer-row > .action { color: var(--paper); border-color: var(--leaf); }
176
+ .ending-list > .offer-row, .detail-checks { border-color: var(--leaf); }
176
177
  }
@@ -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: Relay say as written, starting with its results page line. Show only names with a Name score, ranked by score; '
42
- + 'fewer than 5: say so and run another round, never pad. Name score is how clear the road is, not a probability. '
43
- + 'Do not call again; the complete local results page fills in by itself.\n'
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, ...(needsAlternatives && { [alternativeEndings]: await alternatives }), nameChecks,
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.13",
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.13",
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
- if (triage && args.shortlist) return { display: say, say, ...(local && { source: 'local' }), checkedAt: at, resultPage: url };
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.13",
7
+ "version": "0.1.15",
8
8
  "packages": [
9
9
  {
10
10
  "registryType": "npm",
11
11
  "identifier": "domain-hound",
12
- "version": "0.1.13",
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, purchaseLine } from './display.mjs';
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, quoteOfferLine, withCheckQuoteOffer, withWatchQuoteOffer } from './clis/spaceship/tools.mjs';
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, hostedIntroLines, hostedResult } from './hosted-results.mjs';
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, and keep the local-check notice at the top when shown. '
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
- + 'The hosted check returns domains and prices, followed by 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.',
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
- + 'Use the returned verdicts. If name checks are pending, repeat check_domains with the same input to collect them. '
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 person sees one text block: the display. The structured result repeats the display first, then the fields.
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
- // The receipt keeps all evidence and shop offers. Chat carries every registry status and the prices
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, checks, resultPage, display, complete, pending, source, priceListDate, listPrices, quoteOffer } = result.structuredContent;
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
- let text = display;
196
- if (resultPage) {
197
- const lead = [...(source === 'local' ? [localCheckNotice] : []), resultsLine(resultPage)];
198
- const statusLines = rows.map(({ name, statuses }) => '- ' + md(name) + ' · ' +
199
- (Object.entries(statuses).map(([label, endings]) => label + ' ' +
200
- endings.map(ending => md(ending === name ? ending : '.' + ending)).join(' ')).join(' · ') || 'no registry answer'));
201
- const tail = 'Full shop comparisons and sources are on the Results page.';
202
- const purchase = display.includes(purchaseLine);
203
- const date = checks?.[0]?.priceSnapshot?.checkedAt?.slice(0, 10) ?? priceListDate;
204
- // Keep the rich single-name answer when it fits. In a batch, the short price line shows the
205
- // best listed offer for every available ending, with the payment term made explicit.
206
- const pageLink = resultsLine(resultPage);
207
- const intro = checks?.[0] && hostedIntroLines(checks[0], pending);
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
- return { ...result, content: [{ type: 'text', text }], structuredContent };
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
- if (Object.keys(args).some(key => !['idea', 'wanted', 'avoid', 'round'].includes(key))) {
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
- return toolResult(await renderProgress(lookup.progress, {
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
- return toolResult(JSON.stringify(await render(lookup.outcome.data, lookup)));
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 key = JSON.stringify([triage, streamDomains, Object.entries(args).sort(([a], [b]) => a.localeCompare(b))]);
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 appChecks = [];
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) appChecks.push(apple.then(appStore => { if (appStore) early[index] = { ...answer, appStore }; }));
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(appChecks) }, Math.min(timeout, hostedFirstAnswerMs) - (performance.now() - started))
694
- .then(() => renderHostedLookup([...early], args, triage, { pending: true }));
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, args, triage, { reuse: first?.structuredContent?.resultPage });
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) return 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
- return toolResult(JSON.stringify({ display: attributed('The hosted check is still running. Call the same tool again with the same input to collect it.'),
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
- return lookup.finished ? lookup.result : lookup.first;
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 toolResult(JSON.stringify(triage ? page : withCheckQuoteOffer(page, args)));
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
- return toolResult(JSON.stringify(job.page));
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'));
@@ -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
+ }
@@ -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.** Only names with an available domain, ranked by score, top 8, at least three recipes represented. If fewer than 5 pass, say so and run another round; never pad.
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