@talkspresso/mcp-server 1.4.2 → 1.4.3
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/dist/index.js +2 -2
- package/dist/setup-api.d.ts +1 -0
- package/dist/setup-api.js +13 -0
- package/dist/setup.js +63 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ else if (args.includes('--help')) {
|
|
|
14
14
|
process.exit(0);
|
|
15
15
|
}
|
|
16
16
|
else if (args.includes('--version')) {
|
|
17
|
-
console.log('1.4.
|
|
17
|
+
console.log('1.4.3');
|
|
18
18
|
process.exit(0);
|
|
19
19
|
}
|
|
20
20
|
else {
|
|
@@ -42,7 +42,7 @@ else {
|
|
|
42
42
|
const { registerSubscriptionTools } = await import('./tools/subscription.js');
|
|
43
43
|
const server = new McpServer({
|
|
44
44
|
name: 'talkspresso',
|
|
45
|
-
version: '1.4.
|
|
45
|
+
version: '1.4.3',
|
|
46
46
|
});
|
|
47
47
|
const apiClient = new TalkspressoClient();
|
|
48
48
|
registerAppointmentTools(server, apiClient);
|
package/dist/setup-api.d.ts
CHANGED
package/dist/setup-api.js
CHANGED
|
@@ -73,6 +73,19 @@ export class SetupApiClient {
|
|
|
73
73
|
throw this.formatError(err);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
async checkHandleAvailability(handle) {
|
|
77
|
+
try {
|
|
78
|
+
await this.http.get('/profile/check_handle_availability', {
|
|
79
|
+
params: { profile_handle: handle },
|
|
80
|
+
});
|
|
81
|
+
return true; // 200 = available
|
|
82
|
+
}
|
|
83
|
+
catch (err) {
|
|
84
|
+
if (err.response?.status === 409)
|
|
85
|
+
return false; // taken
|
|
86
|
+
return false; // assume taken on error
|
|
87
|
+
}
|
|
88
|
+
}
|
|
76
89
|
async updateCalendar(data) {
|
|
77
90
|
try {
|
|
78
91
|
const response = await this.http.put('/calendar', data);
|
package/dist/setup.js
CHANGED
|
@@ -178,12 +178,58 @@ export async function runSetup() {
|
|
|
178
178
|
const about = await input({
|
|
179
179
|
message: 'One line about what you offer:',
|
|
180
180
|
});
|
|
181
|
-
|
|
181
|
+
// ── Handle / Vanity URL ────────────────────────────
|
|
182
|
+
let profileHandle = '';
|
|
183
|
+
const defaultHandle = userName.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
|
|
184
|
+
console.log(`\n ${chalk.dim('Your booking page will be:')} ${chalk.cyan(`app.talkspresso.com/`)}${chalk.cyan.bold('<your-handle>')}\n`);
|
|
185
|
+
let handleAttempts = 0;
|
|
186
|
+
while (handleAttempts < 5) {
|
|
187
|
+
const handle = await input({
|
|
188
|
+
message: 'Choose your handle:',
|
|
189
|
+
default: handleAttempts === 0 ? defaultHandle : undefined,
|
|
190
|
+
});
|
|
191
|
+
const cleaned = handle.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
|
|
192
|
+
if (!cleaned || cleaned.length < 3) {
|
|
193
|
+
console.log(` ${chalk.red('✗')} Handle must be at least 3 characters.\n`);
|
|
194
|
+
handleAttempts++;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const available = await api.checkHandleAvailability(cleaned);
|
|
198
|
+
if (available) {
|
|
199
|
+
profileHandle = cleaned;
|
|
200
|
+
console.log(` ${chalk.green('✓')} ${chalk.cyan(`app.talkspresso.com/${cleaned}`)} is yours!\n`);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
console.log(` ${chalk.red('✗')} "${cleaned}" is taken. Try another.\n`);
|
|
205
|
+
handleAttempts++;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// ── Category ───────────────────────────────────────
|
|
209
|
+
const category = await select({
|
|
210
|
+
message: 'What best describes you?',
|
|
211
|
+
choices: [
|
|
212
|
+
{ name: 'Creator / Influencer', value: 'creator' },
|
|
213
|
+
{ name: 'Coach', value: 'coaching' },
|
|
214
|
+
{ name: 'Consultant', value: 'consulting' },
|
|
215
|
+
{ name: 'Therapist / Counselor', value: 'therapy' },
|
|
216
|
+
{ name: 'Tutor / Educator', value: 'education' },
|
|
217
|
+
{ name: 'Other', value: '' },
|
|
218
|
+
],
|
|
219
|
+
});
|
|
220
|
+
// Save profile
|
|
221
|
+
const profileData = {};
|
|
222
|
+
if (expertTitle)
|
|
223
|
+
profileData.expert_title = expertTitle;
|
|
224
|
+
if (about)
|
|
225
|
+
profileData.about = about;
|
|
226
|
+
if (profileHandle)
|
|
227
|
+
profileData.profile_handle = profileHandle;
|
|
228
|
+
if (category)
|
|
229
|
+
profileData.categories = [category];
|
|
230
|
+
if (Object.keys(profileData).length > 0) {
|
|
182
231
|
try {
|
|
183
|
-
await api.updateProfile(
|
|
184
|
-
expert_title: expertTitle || undefined,
|
|
185
|
-
about: about || undefined,
|
|
186
|
-
});
|
|
232
|
+
await api.updateProfile(profileData);
|
|
187
233
|
console.log(` ${chalk.green('✓')} Profile updated\n`);
|
|
188
234
|
}
|
|
189
235
|
catch {
|
|
@@ -301,6 +347,8 @@ export async function runSetup() {
|
|
|
301
347
|
done.push(`API key saved`);
|
|
302
348
|
if (expertTitle)
|
|
303
349
|
done.push(`Profile: ${expertTitle}`);
|
|
350
|
+
if (profileHandle)
|
|
351
|
+
done.push(`Handle: ${profileHandle}`);
|
|
304
352
|
if (serviceChoice !== 'skip')
|
|
305
353
|
done.push('First service created');
|
|
306
354
|
if (availPreset !== 'skip')
|
|
@@ -312,12 +360,21 @@ export async function runSetup() {
|
|
|
312
360
|
for (const item of done) {
|
|
313
361
|
console.log(` ${chalk.green('✓')} ${item}`);
|
|
314
362
|
}
|
|
363
|
+
if (profileHandle) {
|
|
364
|
+
console.log(`\n ${chalk.bold('Your booking page:')}`);
|
|
365
|
+
console.log(` ${chalk.cyan.bold(`https://app.talkspresso.com/${profileHandle}`)}`);
|
|
366
|
+
}
|
|
315
367
|
console.log(`\n ${chalk.bold('What to do next:')}\n`);
|
|
316
368
|
if (configuredDesktop || configuredCode) {
|
|
317
369
|
console.log(` 1. ${chalk.white('Restart Claude')} (if it's open)`);
|
|
318
370
|
console.log(` 2. ${chalk.white('Try:')} "Show me my Talkspresso schedule"`);
|
|
319
371
|
console.log(` 3. ${chalk.white('Try:')} "Connect my Stripe account so I can get paid"`);
|
|
320
|
-
|
|
372
|
+
if (profileHandle) {
|
|
373
|
+
console.log(` 4. ${chalk.white('Share your booking page:')} ${chalk.cyan(`app.talkspresso.com/${profileHandle}`)}`);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
console.log(` 4. ${chalk.white('Try:')} "Get my booking link so I can share it"`);
|
|
377
|
+
}
|
|
321
378
|
}
|
|
322
379
|
else {
|
|
323
380
|
console.log(` 1. ${chalk.white('Run')} ${chalk.cyan('npx @talkspresso/mcp-server --setup')} ${chalk.white('to connect to Claude')}`);
|
package/package.json
CHANGED