slashvibe-mcp 0.3.21 → 0.3.22
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/LICENSE +21 -0
- package/README.md +280 -47
- package/config.js +36 -31
- package/crypto.js +1 -6
- package/discord.js +19 -19
- package/index.js +217 -207
- package/intelligence/index.js +2 -9
- package/intelligence/infer.js +10 -16
- package/intelligence/patterns.js +23 -18
- package/intelligence/proactive.js +16 -15
- package/intelligence/serendipity.js +57 -20
- package/memory.js +13 -8
- package/notify.js +39 -14
- package/package.json +27 -20
- package/presence.js +2 -2
- package/prompts.js +5 -9
- package/protocol/index.js +123 -87
- package/protocol/telegram-commands.js +36 -37
- package/store/api.js +358 -529
- package/store/local.js +9 -10
- package/store/profiles.js +48 -192
- package/store/reservations.js +2 -9
- package/store/skills.js +69 -71
- package/store/sqlite.js +355 -0
- package/tools/_actions.js +48 -387
- package/tools/_connection-queue.js +45 -56
- package/tools/_discovery-enhanced.js +52 -57
- package/tools/_discovery.js +87 -185
- package/tools/{l2-status.js → _experimental/l2-status.js} +68 -70
- package/tools/{shipback.js → _experimental/shipback.js} +4 -3
- package/tools/_proactive-discovery.js +60 -73
- package/tools/_shared/index.js +41 -64
- package/tools/admin-inbox.js +10 -15
- package/tools/agents.js +1 -1
- package/tools/artifact-create.js +13 -23
- package/tools/artifact-view.js +4 -4
- package/tools/{_deprecated/back.js → back.js} +1 -1
- package/tools/bye.js +3 -5
- package/tools/consent.js +2 -2
- package/tools/context.js +9 -10
- package/tools/crossword.js +3 -2
- package/tools/discover.js +94 -356
- package/tools/dm.js +27 -86
- package/tools/doctor.js +12 -41
- package/tools/drawing.js +34 -20
- package/tools/echo.js +11 -11
- package/tools/feed.js +30 -58
- package/tools/follow.js +64 -187
- package/tools/{_deprecated/forget.js → forget.js} +4 -7
- package/tools/game.js +144 -48
- package/tools/handoff.js +6 -8
- package/tools/help.js +3 -3
- package/tools/idea.js +15 -27
- package/tools/inbox.js +121 -293
- package/tools/init.js +54 -151
- package/tools/invite.js +8 -21
- package/tools/migrate.js +27 -24
- package/tools/multiplayer-game.js +50 -40
- package/tools/{_deprecated/mute.js → mute.js} +4 -3
- package/tools/notifications.js +58 -48
- package/tools/observe.js +12 -15
- package/tools/onboarding.js +8 -11
- package/tools/open.js +13 -144
- package/tools/party-game.js +23 -12
- package/tools/patterns.js +2 -1
- package/tools/ping.js +5 -7
- package/tools/react.js +28 -30
- package/tools/{_deprecated/recall.js → recall.js} +5 -10
- package/tools/release.js +4 -2
- package/tools/{_deprecated/remember.js → remember.js} +4 -6
- package/tools/report.js +2 -2
- package/tools/request.js +6 -26
- package/tools/reserve.js +1 -1
- package/tools/session-fork.js +97 -0
- package/tools/session-save.js +109 -0
- package/tools/settings.js +30 -99
- package/tools/ship.js +74 -56
- package/tools/{_deprecated/skills-exchange.js → skills-exchange.js} +38 -39
- package/tools/social-inbox.js +22 -28
- package/tools/social-post.js +24 -27
- package/tools/solo-game.js +54 -46
- package/tools/start.js +14 -148
- package/tools/status.js +21 -68
- package/tools/submit.js +4 -2
- package/tools/suggest-tags.js +36 -33
- package/tools/summarize.js +19 -16
- package/tools/tag-suggestions.js +72 -73
- package/tools/test.js +1 -1
- package/tools/{_deprecated/tictactoe.js → tictactoe.js} +26 -26
- package/tools/token.js +4 -4
- package/tools/update.js +1 -2
- package/tools/watch.js +132 -112
- package/tools/who.js +20 -40
- package/tools/{_deprecated/wordassociation.js → wordassociation.js} +23 -20
- package/tools/workshop-buddy.js +52 -53
- package/tools/x-mentions.js +0 -1
- package/tools/x-reply.js +0 -1
- package/twitter.js +14 -20
- package/version.json +8 -10
- package/analytics.js +0 -107
- package/auth-store.js +0 -148
- package/auto-update.js +0 -130
- package/bridges/bridge-monitor.js +0 -388
- package/bridges/discord-bot.js +0 -431
- package/bridges/farcaster.js +0 -299
- package/bridges/telegram.js +0 -261
- package/bridges/webhook-health.js +0 -420
- package/bridges/webhook-server.js +0 -437
- package/bridges/whatsapp.js +0 -441
- package/bridges/x-webhook.js +0 -423
- package/games/arcade.js +0 -406
- package/games/chess.js +0 -451
- package/games/colorguess.js +0 -343
- package/games/crossword-words.js +0 -171
- package/games/crossword.js +0 -461
- package/games/drawing.js +0 -347
- package/games/gameroulette.js +0 -300
- package/games/gamerouter.js +0 -336
- package/games/gamestatus.js +0 -337
- package/games/guessnumber.js +0 -209
- package/games/hangman.js +0 -279
- package/games/memory.js +0 -338
- package/games/multiplayer-tictactoe.js +0 -389
- package/games/pixelart.js +0 -399
- package/games/quickduel.js +0 -354
- package/games/riddle.js +0 -371
- package/games/rockpaperscissors.js +0 -291
- package/games/snake.js +0 -406
- package/games/storybuilder.js +0 -343
- package/games/tictactoe.js +0 -345
- package/games/twentyquestions.js +0 -286
- package/games/twotruths.js +0 -207
- package/games/werewolf.js +0 -508
- package/games/wordassociation.js +0 -247
- package/games/wordchain.js +0 -135
- package/intelligence/interests.js +0 -369
- package/notification-emitter.js +0 -77
- package/setup.js +0 -480
- package/smart-inbox.js +0 -276
- package/tools/_deprecated/auto-suggest-connections.js +0 -304
- package/tools/_deprecated/bootstrap-skills.js +0 -231
- package/tools/_deprecated/bridge-dashboard.js +0 -342
- package/tools/_deprecated/bridge-health.js +0 -400
- package/tools/_deprecated/bridge-live.js +0 -384
- package/tools/_deprecated/bridges.js +0 -383
- package/tools/_deprecated/colorguess.js +0 -281
- package/tools/_deprecated/discover-insights.js +0 -379
- package/tools/_deprecated/discover-momentum.js +0 -256
- package/tools/_deprecated/discovery-analytics.js +0 -345
- package/tools/_deprecated/discovery-auto-suggest.js +0 -275
- package/tools/_deprecated/discovery-bootstrap.js +0 -267
- package/tools/_deprecated/discovery-daily.js +0 -375
- package/tools/_deprecated/discovery-dashboard.js +0 -385
- package/tools/_deprecated/discovery-digest.js +0 -314
- package/tools/_deprecated/discovery-hub.js +0 -357
- package/tools/_deprecated/discovery-insights.js +0 -384
- package/tools/_deprecated/discovery-momentum.js +0 -281
- package/tools/_deprecated/discovery-monitor.js +0 -319
- package/tools/_deprecated/discovery-proactive.js +0 -300
- package/tools/_deprecated/draw.js +0 -317
- package/tools/_deprecated/farcaster.js +0 -307
- package/tools/_deprecated/games-catalog.js +0 -376
- package/tools/_deprecated/games.js +0 -313
- package/tools/_deprecated/guessnumber.js +0 -194
- package/tools/_deprecated/hangman.js +0 -129
- package/tools/_deprecated/multiplayer-tictactoe.js +0 -303
- package/tools/_deprecated/riddle.js +0 -240
- package/tools/_deprecated/run-bootstrap.js +0 -69
- package/tools/_deprecated/skills-analytics.js +0 -349
- package/tools/_deprecated/skills-bootstrap.js +0 -301
- package/tools/_deprecated/skills-dashboard.js +0 -268
- package/tools/_deprecated/skills.js +0 -380
- package/tools/_deprecated/smart-intro.js +0 -353
- package/tools/_deprecated/storybuilder.js +0 -331
- package/tools/_deprecated/telegram-bot.js +0 -183
- package/tools/_deprecated/telegram-setup.js +0 -214
- package/tools/_deprecated/twentyquestions.js +0 -143
- package/tools/_shared.js +0 -234
- package/tools/_work-context.js +0 -338
- package/tools/_work-context.manual-test.js +0 -199
- package/tools/_work-context.test.js +0 -260
- package/tools/activity.js +0 -220
- package/tools/agent-treasury.js +0 -288
- package/tools/analytics.js +0 -191
- package/tools/approve.js +0 -197
- package/tools/arcade.js +0 -173
- package/tools/artifacts-price.js +0 -107
- package/tools/ask-expert.js +0 -160
- package/tools/available.js +0 -120
- package/tools/become-expert.js +0 -150
- package/tools/broadcast.js +0 -325
- package/tools/chat.js +0 -202
- package/tools/collaborative-drawing.js +0 -286
- package/tools/connection-status.js +0 -178
- package/tools/earnings.js +0 -126
- package/tools/friends.js +0 -207
- package/tools/genesis.js +0 -233
- package/tools/gig-browse.js +0 -206
- package/tools/gig-complete.js +0 -144
- package/tools/health.js +0 -87
- package/tools/leaderboard.js +0 -117
- package/tools/lib/git-apply.js +0 -206
- package/tools/lib/git-bundle.js +0 -407
- package/tools/mint.js +0 -377
- package/tools/plan.js +0 -225
- package/tools/profile.js +0 -219
- package/tools/proof-of-work.js +0 -144
- package/tools/pulse.js +0 -218
- package/tools/reply.js +0 -166
- package/tools/reputation.js +0 -175
- package/tools/schedule.js +0 -367
- package/tools/search-messages.js +0 -123
- package/tools/session.js +0 -467
- package/tools/session_price.js +0 -128
- package/tools/smart-check.js +0 -201
- package/tools/social-processor.js +0 -445
- package/tools/streak.js +0 -147
- package/tools/stuck.js +0 -297
- package/tools/subscribe.js +0 -148
- package/tools/subscriptions.js +0 -134
- package/tools/tip.js +0 -193
- package/tools/wallet.js +0 -269
- package/tools/webhook-test.js +0 -388
- package/tools/withdraw.js +0 -145
- package/tools/work-summary.js +0 -96
- package/tools/workshop.js +0 -327
- /package/tools/{l2-bridge.js → _experimental/l2-bridge.js} +0 -0
- /package/tools/{l2.js → _experimental/l2.js} +0 -0
- /package/tools/{_deprecated/away.js → away.js} +0 -0
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Smart Introductions — AI-powered introduction message generation
|
|
3
|
-
*
|
|
4
|
-
* Creates personalized introduction messages for connection suggestions:
|
|
5
|
-
* - Highlights shared interests and complementary skills
|
|
6
|
-
* - Suggests specific collaboration opportunities
|
|
7
|
-
* - Includes conversation starters
|
|
8
|
-
* - Maintains natural, friendly tone
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const config = require('../config');
|
|
12
|
-
const userProfiles = require('../store/profiles');
|
|
13
|
-
const { requireInit } = require('./_shared');
|
|
14
|
-
|
|
15
|
-
const definition = {
|
|
16
|
-
name: 'vibe_smart_intro',
|
|
17
|
-
description: 'Generate personalized introduction messages for connecting two users.',
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
from: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'Handle of person to write intro for'
|
|
24
|
-
},
|
|
25
|
-
to: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'Handle of person to introduce them to'
|
|
28
|
-
},
|
|
29
|
-
style: {
|
|
30
|
-
type: 'string',
|
|
31
|
-
enum: ['casual', 'professional', 'enthusiastic', 'brief'],
|
|
32
|
-
description: 'Tone of introduction message'
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
required: ['from', 'to']
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// Generate smart introduction message
|
|
40
|
-
async function generateIntroduction(fromHandle, toHandle, style = 'casual') {
|
|
41
|
-
const fromProfile = await userProfiles.getProfile(fromHandle);
|
|
42
|
-
const toProfile = await userProfiles.getProfile(toHandle);
|
|
43
|
-
|
|
44
|
-
// Find connection points
|
|
45
|
-
const connectionPoints = findConnectionPoints(fromProfile, toProfile);
|
|
46
|
-
|
|
47
|
-
if (connectionPoints.shared.length === 0 && connectionPoints.complementary.length === 0) {
|
|
48
|
-
return generateGenericIntro(fromProfile, toProfile, style);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return generatePersonalizedIntro(fromProfile, toProfile, connectionPoints, style);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Find specific connection points between two profiles
|
|
55
|
-
function findConnectionPoints(profile1, profile2) {
|
|
56
|
-
const shared = {
|
|
57
|
-
interests: [],
|
|
58
|
-
tags: [],
|
|
59
|
-
buildingSimilarity: null
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const complementary = {
|
|
63
|
-
skills: [],
|
|
64
|
-
experiences: []
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
// Shared interests
|
|
68
|
-
if (profile1.interests && profile2.interests) {
|
|
69
|
-
shared.interests = profile1.interests.filter(i =>
|
|
70
|
-
profile2.interests.some(j => i.toLowerCase() === j.toLowerCase())
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Shared tags
|
|
75
|
-
if (profile1.tags && profile2.tags) {
|
|
76
|
-
shared.tags = profile1.tags.filter(t =>
|
|
77
|
-
profile2.tags.some(u => t.toLowerCase() === u.toLowerCase())
|
|
78
|
-
);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Building similarity
|
|
82
|
-
if (profile1.building && profile2.building) {
|
|
83
|
-
const building1 = profile1.building.toLowerCase();
|
|
84
|
-
const building2 = profile2.building.toLowerCase();
|
|
85
|
-
|
|
86
|
-
const words1 = building1.split(/\s+/);
|
|
87
|
-
const words2 = building2.split(/\s+/);
|
|
88
|
-
const commonWords = words1.filter(w => words2.includes(w) && w.length > 3);
|
|
89
|
-
|
|
90
|
-
if (commonWords.length > 0) {
|
|
91
|
-
shared.buildingSimilarity = commonWords;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Complementary skills
|
|
96
|
-
const complementaryPairs = [
|
|
97
|
-
[['frontend', 'react', 'vue', 'angular'], ['backend', 'api', 'server', 'database']],
|
|
98
|
-
[['design', 'ui', 'ux', 'figma'], ['engineering', 'development', 'coding']],
|
|
99
|
-
[['ai', 'ml', 'llm'], ['data', 'analytics', 'infrastructure']],
|
|
100
|
-
[['mobile', 'ios', 'android'], ['web', 'frontend', 'fullstack']],
|
|
101
|
-
[['product', 'pm', 'strategy'], ['engineering', 'technical', 'dev']],
|
|
102
|
-
[['marketing', 'growth', 'content'], ['product', 'engineering']],
|
|
103
|
-
[['research', 'academic'], ['implementation', 'production', 'scaling']]
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
for (const [group1, group2] of complementaryPairs) {
|
|
107
|
-
const hasGroup1 = profile1.tags?.some(t =>
|
|
108
|
-
group1.some(g => t.toLowerCase().includes(g))
|
|
109
|
-
);
|
|
110
|
-
const hasGroup2 = profile2.tags?.some(t =>
|
|
111
|
-
group2.some(g => t.toLowerCase().includes(g))
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
if (hasGroup1 && hasGroup2) {
|
|
115
|
-
complementary.skills.push({
|
|
116
|
-
person1Skill: group1.find(g => profile1.tags?.some(t => t.toLowerCase().includes(g))),
|
|
117
|
-
person2Skill: group2.find(g => profile2.tags?.some(t => t.toLowerCase().includes(g)))
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Check reverse
|
|
122
|
-
const hasGroup2First = profile1.tags?.some(t =>
|
|
123
|
-
group2.some(g => t.toLowerCase().includes(g))
|
|
124
|
-
);
|
|
125
|
-
const hasGroup1Second = profile2.tags?.some(t =>
|
|
126
|
-
group1.some(g => t.toLowerCase().includes(g))
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
if (hasGroup2First && hasGroup1Second) {
|
|
130
|
-
complementary.skills.push({
|
|
131
|
-
person1Skill: group2.find(g => profile1.tags?.some(t => t.toLowerCase().includes(g))),
|
|
132
|
-
person2Skill: group1.find(g => profile2.tags?.some(t => t.toLowerCase().includes(g)))
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
return { shared, complementary };
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Generate personalized introduction
|
|
141
|
-
function generatePersonalizedIntro(fromProfile, toProfile, connectionPoints, style) {
|
|
142
|
-
let intro = '';
|
|
143
|
-
|
|
144
|
-
// Opening based on style
|
|
145
|
-
const openings = {
|
|
146
|
-
casual: [`Hey @${toProfile.handle}! 👋`, `Hi @${toProfile.handle}!`],
|
|
147
|
-
professional: [`Hello @${toProfile.handle},`, `Hi @${toProfile.handle},`],
|
|
148
|
-
enthusiastic: [`Hey @${toProfile.handle}! 🚀`, `@${toProfile.handle} - excited to connect!`],
|
|
149
|
-
brief: [`@${toProfile.handle} -`, `Hi @${toProfile.handle} -`]
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
intro += openings[style][0] + '\n\n';
|
|
153
|
-
|
|
154
|
-
// Main connection reason
|
|
155
|
-
if (connectionPoints.shared.buildingSimilarity) {
|
|
156
|
-
intro += `I noticed you're working on ${toProfile.building} - I'm building something similar`;
|
|
157
|
-
if (fromProfile.building) {
|
|
158
|
-
intro += `: ${fromProfile.building}`;
|
|
159
|
-
}
|
|
160
|
-
intro += '. Would love to chat about our approaches!\n\n';
|
|
161
|
-
}
|
|
162
|
-
else if (connectionPoints.shared.interests.length > 0) {
|
|
163
|
-
const sharedInterests = connectionPoints.shared.interests.slice(0, 2);
|
|
164
|
-
intro += `Saw that we both share an interest in ${sharedInterests.join(' and ')}. `;
|
|
165
|
-
if (fromProfile.building && toProfile.building) {
|
|
166
|
-
intro += `I'm working on ${fromProfile.building} and would love to hear about ${toProfile.building}!\n\n`;
|
|
167
|
-
} else {
|
|
168
|
-
intro += `Would love to connect and share what we're each working on!\n\n`;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
else if (connectionPoints.complementary.skills.length > 0) {
|
|
172
|
-
const skill = connectionPoints.complementary.skills[0];
|
|
173
|
-
intro += `I noticed you have ${skill.person2Skill} experience, and I focus on ${skill.person1Skill}. `;
|
|
174
|
-
intro += `Seems like we might have complementary skills - would be great to connect!\n\n`;
|
|
175
|
-
}
|
|
176
|
-
else if (connectionPoints.shared.tags.length > 0) {
|
|
177
|
-
const sharedTags = connectionPoints.shared.tags.slice(0, 2);
|
|
178
|
-
intro += `We both work with ${sharedTags.join(' and ')} - always great to meet fellow builders in the space!\n\n`;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
// Conversation starters
|
|
182
|
-
if (style !== 'brief') {
|
|
183
|
-
intro += addConversationStarters(fromProfile, toProfile, connectionPoints);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Closing based on style
|
|
187
|
-
const closings = {
|
|
188
|
-
casual: 'Looking forward to connecting! ✨',
|
|
189
|
-
professional: 'Would be great to connect and learn more about your work.',
|
|
190
|
-
enthusiastic: 'Excited to learn more about what you\'re building! 🔥',
|
|
191
|
-
brief: 'Would love to connect!'
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
intro += closings[style];
|
|
195
|
-
|
|
196
|
-
return intro;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Add conversation starters
|
|
200
|
-
function addConversationStarters(fromProfile, toProfile, connectionPoints) {
|
|
201
|
-
const starters = [];
|
|
202
|
-
|
|
203
|
-
if (fromProfile.building) {
|
|
204
|
-
starters.push(`I'd love to hear more about ${toProfile.building || 'what you\'re working on'}`);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (connectionPoints.shared.interests.length > 0) {
|
|
208
|
-
const interest = connectionPoints.shared.interests[0];
|
|
209
|
-
starters.push(`How did you get into ${interest}?`);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (connectionPoints.shared.buildingSimilarity) {
|
|
213
|
-
starters.push('What\'s been your biggest challenge so far?');
|
|
214
|
-
starters.push('Have you found any particularly useful tools or resources?');
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (connectionPoints.complementary.skills.length > 0) {
|
|
218
|
-
starters.push('Would be interesting to compare our different perspectives on building');
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (fromProfile.ships?.length > 0) {
|
|
222
|
-
const recentShip = fromProfile.ships[0];
|
|
223
|
-
starters.push(`I recently shipped ${recentShip.what} - would love to hear what you've been working on`);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (starters.length > 0) {
|
|
227
|
-
const randomStarter = starters[Math.floor(Math.random() * starters.length)];
|
|
228
|
-
return `${randomStarter}.\n\n`;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
return '';
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// Generate generic introduction for minimal connection
|
|
235
|
-
function generateGenericIntro(fromProfile, toProfile, style) {
|
|
236
|
-
let intro = '';
|
|
237
|
-
|
|
238
|
-
const openings = {
|
|
239
|
-
casual: `Hey @${toProfile.handle}! 👋`,
|
|
240
|
-
professional: `Hello @${toProfile.handle},`,
|
|
241
|
-
enthusiastic: `Hi @${toProfile.handle}! 🚀`,
|
|
242
|
-
brief: `Hi @${toProfile.handle} -`
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
intro += openings[style] + '\n\n';
|
|
246
|
-
|
|
247
|
-
if (fromProfile.building && toProfile.building) {
|
|
248
|
-
intro += `I'm working on ${fromProfile.building} and saw you're building ${toProfile.building}. `;
|
|
249
|
-
intro += `Always interesting to connect with fellow builders!\n\n`;
|
|
250
|
-
} else if (fromProfile.building) {
|
|
251
|
-
intro += `I'm working on ${fromProfile.building} and would love to connect with other builders. `;
|
|
252
|
-
intro += `What are you working on?\n\n`;
|
|
253
|
-
} else {
|
|
254
|
-
intro += `Saw your profile and would love to connect! What are you currently building?\n\n`;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const closings = {
|
|
258
|
-
casual: 'Looking forward to chatting! ✨',
|
|
259
|
-
professional: 'Would be great to learn more about your work.',
|
|
260
|
-
enthusiastic: 'Excited to connect! 🔥',
|
|
261
|
-
brief: 'Would love to connect!'
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
intro += closings[style];
|
|
265
|
-
|
|
266
|
-
return intro;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
// Generate introduction with explanation of match reasoning
|
|
270
|
-
function generateIntroWithReasoning(fromProfile, toProfile, matchScore, matchReasons) {
|
|
271
|
-
let intro = `Hey @${toProfile.handle}! 👋\n\n`;
|
|
272
|
-
|
|
273
|
-
intro += `I came across your profile through /vibe's discovery system `;
|
|
274
|
-
intro += `(we got a ${matchScore}% match score!) and thought we should connect.\n\n`;
|
|
275
|
-
|
|
276
|
-
if (matchReasons.length > 0) {
|
|
277
|
-
intro += `Here's why I think we'd click:\n`;
|
|
278
|
-
for (const reason of matchReasons.slice(0, 2)) {
|
|
279
|
-
intro += `• ${reason}\n`;
|
|
280
|
-
}
|
|
281
|
-
intro += `\n`;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
if (fromProfile.building && toProfile.building) {
|
|
285
|
-
intro += `I'm working on ${fromProfile.building}, and I'd love to hear about ${toProfile.building}!\n\n`;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
intro += `Would love to connect and share what we're each building! ✨`;
|
|
289
|
-
|
|
290
|
-
return intro;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
// Main handler function
|
|
294
|
-
async function handler(args) {
|
|
295
|
-
const initCheck = requireInit();
|
|
296
|
-
if (initCheck) return initCheck;
|
|
297
|
-
|
|
298
|
-
const { from, to, style } = args;
|
|
299
|
-
|
|
300
|
-
if (!from || !to) {
|
|
301
|
-
return {
|
|
302
|
-
error: 'Please specify both users: smart-intro from @alice to @bob'
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
const fromHandle = from.replace('@', '');
|
|
307
|
-
const toHandle = to.replace('@', '');
|
|
308
|
-
|
|
309
|
-
if (fromHandle === toHandle) {
|
|
310
|
-
return {
|
|
311
|
-
error: 'Cannot create introduction message to yourself!'
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
try {
|
|
316
|
-
// Check if these users have already been connected
|
|
317
|
-
const hasConnected = await userProfiles.hasBeenConnected(fromHandle, toHandle);
|
|
318
|
-
|
|
319
|
-
if (hasConnected) {
|
|
320
|
-
return {
|
|
321
|
-
display: `## Already Connected! 🔗
|
|
322
|
-
|
|
323
|
-
@${fromHandle} and @${toHandle} have been introduced before.
|
|
324
|
-
|
|
325
|
-
**Try:**
|
|
326
|
-
- \`discover suggest\` for new recommendations
|
|
327
|
-
- \`discover active\` to find other builders online`
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const introduction = await generateIntroduction(fromHandle, toHandle, style);
|
|
332
|
-
|
|
333
|
-
return {
|
|
334
|
-
display: `## Smart Introduction Generated 💌
|
|
335
|
-
|
|
336
|
-
**From @${fromHandle} to @${toHandle}:**
|
|
337
|
-
|
|
338
|
-
${introduction}
|
|
339
|
-
|
|
340
|
-
**Next steps:**
|
|
341
|
-
- Copy and send this via \`message @${toHandle}\`
|
|
342
|
-
- Or customize it to match your voice
|
|
343
|
-
- Use \`smart-intro from @${fromHandle} to @${toHandle} style professional\` for different tones`
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
} catch (error) {
|
|
347
|
-
return {
|
|
348
|
-
error: `Failed to generate introduction: ${error.message}`
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
module.exports = { definition, handler, generateIntroduction, generateIntroWithReasoning };
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe story-builder — Collaborative storytelling game
|
|
3
|
-
*
|
|
4
|
-
* Build stories together! Each player adds one sentence to create
|
|
5
|
-
* an epic collaborative tale. Perfect for creative groups!
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const config = require('../config');
|
|
9
|
-
const store = require('../store');
|
|
10
|
-
const { createGamePayload } = require('../protocol');
|
|
11
|
-
const { requireInit, normalizeHandle } = require('./_shared');
|
|
12
|
-
|
|
13
|
-
// Import story builder game implementation
|
|
14
|
-
const storyBuilder = require('../games/storybuilder');
|
|
15
|
-
|
|
16
|
-
// Story rooms stored in memory (TODO: move to database)
|
|
17
|
-
const storyRooms = new Map();
|
|
18
|
-
|
|
19
|
-
const definition = {
|
|
20
|
-
name: 'vibe_story_builder',
|
|
21
|
-
description: 'Collaborative storytelling! Take turns adding sentences to build creative stories together.',
|
|
22
|
-
inputSchema: {
|
|
23
|
-
type: 'object',
|
|
24
|
-
properties: {
|
|
25
|
-
action: {
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'Action to take',
|
|
28
|
-
enum: ['create', 'join', 'add', 'status', 'list', 'stats']
|
|
29
|
-
},
|
|
30
|
-
roomId: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Story room ID (auto-generated if creating)'
|
|
33
|
-
},
|
|
34
|
-
sentence: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Sentence to add to the story'
|
|
37
|
-
},
|
|
38
|
-
genre: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Genre for new stories (mystery, scifi, fantasy, comedy)',
|
|
41
|
-
enum: ['mystery', 'scifi', 'fantasy', 'comedy']
|
|
42
|
-
},
|
|
43
|
-
prompt: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
description: 'Custom story prompt (overrides genre)'
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
required: []
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
// Generate a short room ID
|
|
53
|
-
function generateRoomId() {
|
|
54
|
-
return Math.random().toString(36).substring(2, 8);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Create a new story room
|
|
58
|
-
function createStoryRoom(host, genre = null, customPrompt = null, roomId = null) {
|
|
59
|
-
const id = roomId || generateRoomId();
|
|
60
|
-
|
|
61
|
-
const initialState = storyBuilder.createInitialStoryBuilderState(genre, customPrompt);
|
|
62
|
-
const addResult = storyBuilder.addPlayer(initialState, host);
|
|
63
|
-
|
|
64
|
-
if (addResult.error) {
|
|
65
|
-
return { error: addResult.error };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const room = {
|
|
69
|
-
id,
|
|
70
|
-
host,
|
|
71
|
-
state: addResult.gameState,
|
|
72
|
-
createdAt: new Date().toISOString(),
|
|
73
|
-
lastActivity: new Date().toISOString()
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
storyRooms.set(id, room);
|
|
77
|
-
return { success: true, room };
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Join an existing story room
|
|
81
|
-
function joinStoryRoom(roomId, playerHandle) {
|
|
82
|
-
const room = storyRooms.get(roomId);
|
|
83
|
-
if (!room) {
|
|
84
|
-
return { error: 'Story room not found' };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const addResult = storyBuilder.addPlayer(room.state, playerHandle);
|
|
88
|
-
if (addResult.error) {
|
|
89
|
-
return { error: addResult.error };
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
room.state = addResult.gameState;
|
|
93
|
-
room.lastActivity = new Date().toISOString();
|
|
94
|
-
return { success: true, room };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
// Add sentence to story
|
|
98
|
-
function addSentenceToRoom(roomId, playerHandle, sentence) {
|
|
99
|
-
const room = storyRooms.get(roomId);
|
|
100
|
-
if (!room) {
|
|
101
|
-
return { error: 'Story room not found' };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const addResult = storyBuilder.addSentence(room.state, sentence, playerHandle);
|
|
105
|
-
if (addResult.error) {
|
|
106
|
-
return { error: addResult.error };
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
room.state = addResult.gameState;
|
|
110
|
-
room.lastActivity = new Date().toISOString();
|
|
111
|
-
return { success: true, room };
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Format display for story builder
|
|
115
|
-
function formatStoryDisplay(room, viewerHandle) {
|
|
116
|
-
const display = storyBuilder.formatStoryBuilderDisplay(room.state);
|
|
117
|
-
const stats = storyBuilder.getStoryStats(room.state);
|
|
118
|
-
const themes = storyBuilder.analyzeStoryThemes(room.state);
|
|
119
|
-
|
|
120
|
-
let output = `## 📖 Story Builder (Room: ${room.id})\n\n${display}`;
|
|
121
|
-
|
|
122
|
-
// Add room info
|
|
123
|
-
output += `\n\n**Room Info:**\n`;
|
|
124
|
-
output += `- ID: \`${room.id}\`\n`;
|
|
125
|
-
output += `- Host: @${room.host}\n`;
|
|
126
|
-
output += `- Created: ${new Date(room.createdAt).toLocaleTimeString()}\n`;
|
|
127
|
-
|
|
128
|
-
// Show detected themes if any
|
|
129
|
-
if (themes.length > 0) {
|
|
130
|
-
output += `\n**Detected themes:** ${themes.join(', ')}\n`;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return output;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Clean up old rooms
|
|
137
|
-
function cleanupOldRooms() {
|
|
138
|
-
const now = new Date();
|
|
139
|
-
const oldRooms = [];
|
|
140
|
-
|
|
141
|
-
for (const [id, room] of storyRooms.entries()) {
|
|
142
|
-
const lastActivity = new Date(room.lastActivity);
|
|
143
|
-
const hoursSinceActivity = (now - lastActivity) / (1000 * 60 * 60);
|
|
144
|
-
|
|
145
|
-
// Remove rooms inactive for 3+ hours (stories take longer)
|
|
146
|
-
if (hoursSinceActivity > 3) {
|
|
147
|
-
oldRooms.push(id);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
for (const id of oldRooms) {
|
|
152
|
-
storyRooms.delete(id);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return oldRooms.length;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async function handler(args) {
|
|
159
|
-
const initCheck = requireInit();
|
|
160
|
-
if (initCheck) return initCheck;
|
|
161
|
-
|
|
162
|
-
const { action = 'status', roomId, sentence, genre, prompt } = args;
|
|
163
|
-
const myHandle = config.getHandle();
|
|
164
|
-
|
|
165
|
-
// Clean up old rooms periodically
|
|
166
|
-
if (Math.random() < 0.1) { // 10% chance on each call
|
|
167
|
-
cleanupOldRooms();
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
// List active story rooms
|
|
171
|
-
if (action === 'list') {
|
|
172
|
-
const activeRooms = Array.from(storyRooms.values())
|
|
173
|
-
.sort((a, b) => new Date(b.lastActivity) - new Date(a.lastActivity));
|
|
174
|
-
|
|
175
|
-
if (activeRooms.length === 0) {
|
|
176
|
-
return {
|
|
177
|
-
display: `## 📖 Story Builder\n\nNo active stories found.\n\nCreate one: \`vibe story-builder --action create\``
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
let display = `## 📖 Active Story Rooms\n\n`;
|
|
182
|
-
|
|
183
|
-
for (const room of activeRooms.slice(0, 10)) { // Show max 10
|
|
184
|
-
const players = room.state.players || [];
|
|
185
|
-
const sentences = room.state.sentences?.length || 0;
|
|
186
|
-
const status = room.state.gameOver ? '✅ Complete' : `📝 Writing (${sentences} sentences)`;
|
|
187
|
-
const lastActivity = new Date(room.lastActivity).toLocaleTimeString();
|
|
188
|
-
const genreText = room.state.genre !== 'general' ? ` [${room.state.genre}]` : '';
|
|
189
|
-
|
|
190
|
-
display += `**${room.id}**${genreText} - ${status}\n`;
|
|
191
|
-
display += ` Host: @${room.host} | Writers: ${players.map(p => `@${p}`).join(', ')}\n`;
|
|
192
|
-
display += ` Last activity: ${lastActivity}\n`;
|
|
193
|
-
display += ` Join: \`vibe story-builder --action join --roomId ${room.id}\`\n\n`;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return { display };
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// Create new story room
|
|
200
|
-
if (action === 'create') {
|
|
201
|
-
const result = createStoryRoom(myHandle, genre, prompt, roomId);
|
|
202
|
-
if (result.error) {
|
|
203
|
-
return { display: `❌ ${result.error}` };
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const room = result.room;
|
|
207
|
-
const display = formatStoryDisplay(room, myHandle);
|
|
208
|
-
|
|
209
|
-
const genreText = genre ? ` (${genre} genre)` : '';
|
|
210
|
-
const promptText = prompt ? ` with custom prompt` : '';
|
|
211
|
-
|
|
212
|
-
return {
|
|
213
|
-
display: `${display}\n\n🎉 **Story room created${genreText}${promptText}!** Share this ID: \`${room.id}\`\n\nOthers can join: \`vibe story-builder --action join --roomId ${room.id}\``
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// Join existing story room
|
|
218
|
-
if (action === 'join') {
|
|
219
|
-
if (!roomId) {
|
|
220
|
-
return { display: '❌ Room ID required. Use `--roomId ABC123`' };
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
const result = joinStoryRoom(roomId, myHandle);
|
|
224
|
-
if (result.error) {
|
|
225
|
-
return { display: `❌ ${result.error}` };
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const room = result.room;
|
|
229
|
-
const display = formatStoryDisplay(room, myHandle);
|
|
230
|
-
|
|
231
|
-
return {
|
|
232
|
-
display: `${display}\n\n✅ **Joined story room ${roomId}!** You can now contribute to the tale.`
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// Add sentence to story
|
|
237
|
-
if (action === 'add') {
|
|
238
|
-
if (!roomId) {
|
|
239
|
-
return { display: '❌ Room ID required. Use `--roomId ABC123`' };
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (!sentence) {
|
|
243
|
-
return { display: '❌ Sentence required. Use `--sentence "The hero discovered something amazing."`' };
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
const result = addSentenceToRoom(roomId, myHandle, sentence);
|
|
247
|
-
if (result.error) {
|
|
248
|
-
return { display: `❌ ${result.error}` };
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
const room = result.room;
|
|
252
|
-
const display = formatStoryDisplay(room, myHandle);
|
|
253
|
-
|
|
254
|
-
return {
|
|
255
|
-
display: `${display}\n\n✅ **Added to the story!** "${sentence}"`
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// Show story statistics
|
|
260
|
-
if (action === 'stats') {
|
|
261
|
-
if (!roomId) {
|
|
262
|
-
return { display: '❌ Room ID required. Use `--roomId ABC123`' };
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
const room = storyRooms.get(roomId);
|
|
266
|
-
if (!room) {
|
|
267
|
-
return { display: `❌ Room ${roomId} not found.` };
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const stats = storyBuilder.getStoryStats(room.state);
|
|
271
|
-
const themes = storyBuilder.analyzeStoryThemes(room.state);
|
|
272
|
-
|
|
273
|
-
if (!stats) {
|
|
274
|
-
return { display: `📊 **Story Statistics for ${roomId}**\n\nStory just started - no stats yet!` };
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
let statsDisplay = `📊 **Story Statistics for ${roomId}**\n\n`;
|
|
278
|
-
statsDisplay += `• Total sentences: ${stats.totalSentences}\n`;
|
|
279
|
-
statsDisplay += `• Total words: ${stats.totalWords}\n`;
|
|
280
|
-
statsDisplay += `• Average words per sentence: ${stats.avgWordsPerSentence}\n`;
|
|
281
|
-
statsDisplay += `• Contributors: ${stats.contributors}\n`;
|
|
282
|
-
|
|
283
|
-
if (stats.longestSentence) {
|
|
284
|
-
statsDisplay += `• Longest sentence: "${stats.longestSentence}"\n`;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (stats.shortestSentence && stats.shortestSentence !== room.state.prompt) {
|
|
288
|
-
statsDisplay += `• Shortest sentence: "${stats.shortestSentence}"\n`;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (themes.length > 0) {
|
|
292
|
-
statsDisplay += `\n**Themes detected:** ${themes.join(', ')}\n`;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return { display: statsDisplay };
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Show room status (default)
|
|
299
|
-
if (roomId) {
|
|
300
|
-
const room = storyRooms.get(roomId);
|
|
301
|
-
if (!room) {
|
|
302
|
-
return { display: `❌ Room ${roomId} not found.` };
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const display = formatStoryDisplay(room, myHandle);
|
|
306
|
-
|
|
307
|
-
const instructions = room.state.gameOver ?
|
|
308
|
-
'\n\n🎉 Story complete! Create a new one with `vibe story-builder --action create`' :
|
|
309
|
-
`\n\nTo add a sentence: \`vibe story-builder --action add --roomId ${roomId} --sentence "Your sentence here."\``;
|
|
310
|
-
|
|
311
|
-
return {
|
|
312
|
-
display: `${display}${instructions}`
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// No room ID provided - show help
|
|
317
|
-
return {
|
|
318
|
-
display: `## 📖 Story Builder\n\n**Collaborative storytelling!** Take turns adding sentences to build creative stories together.\n\n**Commands:**\n` +
|
|
319
|
-
`- \`--action create\` - Start new story\n` +
|
|
320
|
-
`- \`--action create --genre mystery\` - Start genre story\n` +
|
|
321
|
-
`- \`--action create --prompt "Once upon a time..."\` - Custom prompt\n` +
|
|
322
|
-
`- \`--action list\` - List active stories\n` +
|
|
323
|
-
`- \`--action join --roomId ABC123\` - Join story\n` +
|
|
324
|
-
`- \`--action add --roomId ABC123 --sentence "..."\` - Add sentence\n` +
|
|
325
|
-
`- \`--action stats --roomId ABC123\` - View statistics\n` +
|
|
326
|
-
`- \`--roomId ABC123\` - Show story status\n\n` +
|
|
327
|
-
`**Genres:** mystery, scifi, fantasy, comedy`
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
module.exports = { definition, handler };
|