slashvibe-mcp 0.2.9 → 0.3.13

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.
Files changed (205) hide show
  1. package/README.md +1 -0
  2. package/analytics.js +107 -0
  3. package/auth-store.js +148 -0
  4. package/auto-update.js +130 -0
  5. package/bridges/bridge-monitor.js +388 -0
  6. package/bridges/discord-bot.js +431 -0
  7. package/bridges/farcaster.js +299 -0
  8. package/bridges/telegram.js +261 -0
  9. package/bridges/webhook-health.js +420 -0
  10. package/bridges/webhook-server.js +437 -0
  11. package/bridges/whatsapp.js +441 -0
  12. package/bridges/x-webhook.js +423 -0
  13. package/config.js +154 -5
  14. package/crypto.js +3 -8
  15. package/games/arcade.js +406 -0
  16. package/games/chess.js +451 -0
  17. package/games/colorguess.js +343 -0
  18. package/games/crossword-words.js +171 -0
  19. package/games/crossword.js +461 -0
  20. package/games/drawing.js +347 -0
  21. package/games/gameroulette.js +300 -0
  22. package/games/gamerouter.js +336 -0
  23. package/games/gamestatus.js +337 -0
  24. package/games/guessnumber.js +209 -0
  25. package/games/hangman.js +279 -0
  26. package/games/memory.js +338 -0
  27. package/games/multiplayer-tictactoe.js +389 -0
  28. package/games/pixelart.js +399 -0
  29. package/games/quickduel.js +354 -0
  30. package/games/riddle.js +371 -0
  31. package/games/rockpaperscissors.js +291 -0
  32. package/games/snake.js +406 -0
  33. package/games/storybuilder.js +343 -0
  34. package/games/tictactoe.js +345 -0
  35. package/games/twentyquestions.js +286 -0
  36. package/games/twotruths.js +207 -0
  37. package/games/werewolf.js +508 -0
  38. package/games/wordassociation.js +247 -0
  39. package/games/wordchain.js +135 -0
  40. package/index.js +105 -216
  41. package/intelligence/index.js +45 -0
  42. package/intelligence/infer.js +316 -0
  43. package/intelligence/interests.js +369 -0
  44. package/intelligence/patterns.js +651 -0
  45. package/intelligence/proactive.js +358 -0
  46. package/intelligence/serendipity.js +306 -0
  47. package/memory.js +166 -0
  48. package/notification-emitter.js +77 -0
  49. package/notify.js +102 -1
  50. package/package.json +21 -7
  51. package/prompts.js +1 -1
  52. package/protocol/index.js +161 -1
  53. package/setup.js +402 -0
  54. package/store/api.js +528 -82
  55. package/store/profiles.js +160 -12
  56. package/tools/_actions.js +463 -16
  57. package/tools/_deprecated/auto-suggest-connections.js +304 -0
  58. package/tools/_deprecated/bootstrap-skills.js +231 -0
  59. package/tools/_deprecated/bridge-dashboard.js +342 -0
  60. package/tools/_deprecated/bridge-health.js +400 -0
  61. package/tools/_deprecated/bridge-live.js +384 -0
  62. package/tools/_deprecated/bridges.js +383 -0
  63. package/tools/_deprecated/colorguess.js +281 -0
  64. package/tools/_deprecated/discover-insights.js +379 -0
  65. package/tools/_deprecated/discover-momentum.js +256 -0
  66. package/tools/_deprecated/discovery-analytics.js +345 -0
  67. package/tools/_deprecated/discovery-auto-suggest.js +275 -0
  68. package/tools/_deprecated/discovery-bootstrap.js +267 -0
  69. package/tools/_deprecated/discovery-daily.js +375 -0
  70. package/tools/_deprecated/discovery-dashboard.js +385 -0
  71. package/tools/_deprecated/discovery-digest.js +314 -0
  72. package/tools/_deprecated/discovery-hub.js +357 -0
  73. package/tools/_deprecated/discovery-insights.js +384 -0
  74. package/tools/_deprecated/discovery-momentum.js +281 -0
  75. package/tools/_deprecated/discovery-monitor.js +319 -0
  76. package/tools/_deprecated/discovery-proactive.js +300 -0
  77. package/tools/_deprecated/draw.js +317 -0
  78. package/tools/_deprecated/farcaster.js +307 -0
  79. package/tools/_deprecated/forget.js +119 -0
  80. package/tools/_deprecated/games-catalog.js +376 -0
  81. package/tools/_deprecated/games.js +313 -0
  82. package/tools/_deprecated/guessnumber.js +194 -0
  83. package/tools/_deprecated/hangman.js +129 -0
  84. package/tools/_deprecated/multiplayer-tictactoe.js +303 -0
  85. package/tools/_deprecated/recall.js +147 -0
  86. package/tools/_deprecated/remember.js +86 -0
  87. package/tools/_deprecated/riddle.js +240 -0
  88. package/tools/_deprecated/run-bootstrap.js +69 -0
  89. package/tools/_deprecated/skills-analytics.js +349 -0
  90. package/tools/_deprecated/skills-bootstrap.js +301 -0
  91. package/tools/_deprecated/skills-dashboard.js +268 -0
  92. package/tools/_deprecated/skills.js +380 -0
  93. package/tools/_deprecated/smart-intro.js +353 -0
  94. package/tools/_deprecated/storybuilder.js +331 -0
  95. package/tools/_deprecated/telegram-bot.js +183 -0
  96. package/tools/_deprecated/telegram-setup.js +214 -0
  97. package/tools/_deprecated/twentyquestions.js +143 -0
  98. package/tools/_discovery-enhanced.js +290 -0
  99. package/tools/_discovery.js +439 -0
  100. package/tools/_proactive-discovery.js +301 -0
  101. package/tools/_shared/index.js +64 -0
  102. package/tools/_shared.js +234 -0
  103. package/tools/_work-context.js +338 -0
  104. package/tools/_work-context.manual-test.js +199 -0
  105. package/tools/_work-context.test.js +260 -0
  106. package/tools/activity.js +220 -0
  107. package/tools/admin-inbox.js +218 -0
  108. package/tools/agent-treasury.js +288 -0
  109. package/tools/analytics.js +191 -0
  110. package/tools/approve.js +197 -0
  111. package/tools/arcade.js +173 -0
  112. package/tools/artifact-create.js +17 -11
  113. package/tools/artifact-view.js +31 -1
  114. package/tools/artifacts-price.js +47 -43
  115. package/tools/ask-expert.js +160 -0
  116. package/tools/available.js +120 -0
  117. package/tools/become-expert.js +150 -0
  118. package/tools/broadcast.js +286 -0
  119. package/tools/chat.js +202 -0
  120. package/tools/collaborative-drawing.js +286 -0
  121. package/tools/connection-status.js +178 -0
  122. package/tools/crossword.js +17 -1
  123. package/tools/discover.js +350 -34
  124. package/tools/dm.js +115 -73
  125. package/tools/drawing.js +1 -1
  126. package/tools/earnings.js +126 -0
  127. package/tools/echo.js +16 -0
  128. package/tools/feed.js +51 -7
  129. package/tools/follow.js +224 -0
  130. package/tools/friends.js +207 -0
  131. package/tools/game.js +2 -2
  132. package/tools/genesis.js +233 -0
  133. package/tools/gig-browse.js +206 -0
  134. package/tools/gig-complete.js +144 -0
  135. package/tools/handoff.js +7 -1
  136. package/tools/help.js +4 -4
  137. package/tools/idea.js +9 -2
  138. package/tools/inbox.js +334 -28
  139. package/tools/init.js +727 -36
  140. package/tools/invite.js +15 -4
  141. package/tools/l2-bridge.js +272 -0
  142. package/tools/l2-status.js +217 -0
  143. package/tools/l2.js +206 -0
  144. package/tools/migrate.js +156 -0
  145. package/tools/mint.js +377 -0
  146. package/tools/multiplayer-game.js +1 -1
  147. package/tools/notifications.js +415 -0
  148. package/tools/observe.js +200 -0
  149. package/tools/onboarding.js +147 -0
  150. package/tools/open.js +143 -12
  151. package/tools/party-game.js +2 -2
  152. package/tools/plan.js +225 -0
  153. package/tools/presence-agent.js +7 -0
  154. package/tools/proof-of-work.js +100 -104
  155. package/tools/pulse.js +218 -0
  156. package/tools/reply.js +166 -0
  157. package/tools/report.js +2 -2
  158. package/tools/reputation.js +175 -0
  159. package/tools/request.js +17 -3
  160. package/tools/schedule.js +367 -0
  161. package/tools/search-messages.js +123 -0
  162. package/tools/session.js +420 -0
  163. package/tools/session_price.js +128 -0
  164. package/tools/settings.js +126 -3
  165. package/tools/ship.js +31 -8
  166. package/tools/shipback.js +326 -0
  167. package/tools/smart-check.js +201 -0
  168. package/tools/social-processor.js +445 -0
  169. package/tools/solo-game.js +1 -1
  170. package/tools/start.js +335 -93
  171. package/tools/status.js +53 -6
  172. package/tools/stuck.js +297 -0
  173. package/tools/subscribe.js +148 -0
  174. package/tools/subscriptions.js +134 -0
  175. package/tools/suggest-tags.js +6 -8
  176. package/tools/tag-suggestions.js +257 -0
  177. package/tools/tip.js +193 -0
  178. package/tools/token.js +103 -0
  179. package/tools/update.js +1 -1
  180. package/tools/wallet.js +239 -186
  181. package/tools/watch.js +157 -0
  182. package/tools/webhook-test.js +388 -0
  183. package/tools/who.js +54 -3
  184. package/tools/withdraw.js +145 -0
  185. package/tools/work-summary.js +96 -0
  186. package/tools/workshop.js +327 -0
  187. package/tools/x-mentions.js +1 -1
  188. package/version.json +14 -3
  189. package/tools/artifacts-buy.js +0 -111
  190. package/tools/connect.js +0 -284
  191. package/tools/gigs-apply.js +0 -99
  192. package/tools/gigs-browse.js +0 -114
  193. package/tools/gigs-complete.js +0 -128
  194. package/tools/gigs-post.js +0 -140
  195. package/tools/live-off.js +0 -109
  196. package/tools/live-watch.js +0 -176
  197. package/tools/live.js +0 -128
  198. package/tools/sessions-browse.js +0 -105
  199. package/tools/whats-happening.js +0 -125
  200. /package/tools/{away.js → _deprecated/away.js} +0 -0
  201. /package/tools/{back.js → _deprecated/back.js} +0 -0
  202. /package/tools/{mute.js → _deprecated/mute.js} +0 -0
  203. /package/tools/{skills-exchange.js → _deprecated/skills-exchange.js} +0 -0
  204. /package/tools/{tictactoe.js → _deprecated/tictactoe.js} +0 -0
  205. /package/tools/{wordassociation.js → _deprecated/wordassociation.js} +0 -0
@@ -0,0 +1,267 @@
1
+ /**
2
+ * vibe discovery-bootstrap — Seed discovery system with sample profiles
3
+ *
4
+ * Creates realistic user profiles to populate the discovery system
5
+ * for testing and demonstration of workshop-buddy and skills-exchange features.
6
+ */
7
+
8
+ const config = require('../config');
9
+ const userProfiles = require('../store/profiles');
10
+ const store = require('../store');
11
+ const { requireInit } = require('./_shared');
12
+
13
+ const definition = {
14
+ name: 'vibe_discovery_bootstrap',
15
+ description: 'Bootstrap the discovery system with sample profiles for testing.',
16
+ inputSchema: {
17
+ type: 'object',
18
+ properties: {
19
+ count: {
20
+ type: 'number',
21
+ default: 10,
22
+ description: 'Number of sample profiles to create'
23
+ },
24
+ clear: {
25
+ type: 'boolean',
26
+ default: false,
27
+ description: 'Clear existing profiles first'
28
+ }
29
+ }
30
+ }
31
+ };
32
+
33
+ // Sample profiles with complementary skills
34
+ const sampleProfiles = [
35
+ {
36
+ handle: 'alex_frontend',
37
+ building: 'React dashboard for startup analytics',
38
+ interests: ['startups', 'design-systems', 'data-visualization'],
39
+ tags: ['frontend', 'react', 'typescript', 'css'],
40
+ mock: true
41
+ },
42
+ {
43
+ handle: 'sam_backend',
44
+ building: 'Scalable API infrastructure for fintech',
45
+ interests: ['fintech', 'distributed-systems', 'security'],
46
+ tags: ['backend', 'python', 'postgres', 'docker'],
47
+ mock: true
48
+ },
49
+ {
50
+ handle: 'jordan_design',
51
+ building: 'Design system for healthcare apps',
52
+ interests: ['healthcare', 'accessibility', 'user-research'],
53
+ tags: ['ui', 'ux', 'figma', 'design-systems'],
54
+ mock: true
55
+ },
56
+ {
57
+ handle: 'casey_ai',
58
+ building: 'AI-powered content generation tool',
59
+ interests: ['ai', 'content', 'automation'],
60
+ tags: ['ai', 'python', 'machine-learning', 'nlp'],
61
+ mock: true
62
+ },
63
+ {
64
+ handle: 'taylor_product',
65
+ building: 'B2B SaaS for project management',
66
+ interests: ['product-management', 'b2b', 'user-research'],
67
+ tags: ['product', 'strategy', 'user-research', 'analytics'],
68
+ mock: true
69
+ },
70
+ {
71
+ handle: 'riley_mobile',
72
+ building: 'React Native app for fitness tracking',
73
+ interests: ['fitness', 'mobile', 'health'],
74
+ tags: ['mobile', 'react-native', 'ios', 'android'],
75
+ mock: true
76
+ },
77
+ {
78
+ handle: 'morgan_devops',
79
+ building: 'Kubernetes deployment automation',
80
+ interests: ['infrastructure', 'automation', 'monitoring'],
81
+ tags: ['devops', 'kubernetes', 'aws', 'monitoring'],
82
+ mock: true
83
+ },
84
+ {
85
+ handle: 'avery_data',
86
+ building: 'ML pipeline for e-commerce recommendations',
87
+ interests: ['data-science', 'e-commerce', 'recommendation-systems'],
88
+ tags: ['data', 'python', 'spark', 'machine-learning'],
89
+ mock: true
90
+ },
91
+ {
92
+ handle: 'quinn_marketing',
93
+ building: 'Growth strategy for developer tools',
94
+ interests: ['developer-marketing', 'growth', 'content'],
95
+ tags: ['marketing', 'growth', 'content', 'developer-relations'],
96
+ mock: true
97
+ },
98
+ {
99
+ handle: 'sage_security',
100
+ building: 'Security audit tools for web apps',
101
+ interests: ['cybersecurity', 'web-security', 'penetration-testing'],
102
+ tags: ['security', 'penetration-testing', 'web-security', 'python'],
103
+ mock: true
104
+ }
105
+ ];
106
+
107
+ // Sample skill exchanges
108
+ const sampleSkillExchanges = [
109
+ {
110
+ handle: 'alex_frontend',
111
+ type: 'offer',
112
+ skill: 'React development',
113
+ details: '5+ years building complex frontend apps',
114
+ category: 'technical'
115
+ },
116
+ {
117
+ handle: 'alex_frontend',
118
+ type: 'request',
119
+ skill: 'backend architecture',
120
+ details: 'Learning how to build scalable APIs',
121
+ category: 'technical'
122
+ },
123
+ {
124
+ handle: 'jordan_design',
125
+ type: 'offer',
126
+ skill: 'UI/UX design',
127
+ details: 'Can help with user research and interface design',
128
+ category: 'design'
129
+ },
130
+ {
131
+ handle: 'casey_ai',
132
+ type: 'request',
133
+ skill: 'product strategy',
134
+ details: 'Need help positioning AI tools for market',
135
+ category: 'business'
136
+ },
137
+ {
138
+ handle: 'taylor_product',
139
+ type: 'offer',
140
+ skill: 'product strategy',
141
+ details: 'B2B product experience, market positioning',
142
+ category: 'business'
143
+ },
144
+ {
145
+ handle: 'riley_mobile',
146
+ type: 'request',
147
+ skill: 'UI design',
148
+ details: 'App needs better visual design',
149
+ category: 'design'
150
+ }
151
+ ];
152
+
153
+ async function createSampleProfiles(count = 10, clearFirst = false) {
154
+ const results = {
155
+ created: 0,
156
+ exchanges: 0,
157
+ errors: []
158
+ };
159
+
160
+ try {
161
+ // Clear existing profiles if requested
162
+ if (clearFirst) {
163
+ // Note: This would require implementing a clear function in profiles.js
164
+ console.log('Clearing existing profiles...');
165
+ }
166
+
167
+ // Create profiles
168
+ const profilesToCreate = sampleProfiles.slice(0, count);
169
+
170
+ for (const profile of profilesToCreate) {
171
+ try {
172
+ const now = Date.now();
173
+ const lastSeen = now - Math.random() * 24 * 60 * 60 * 1000; // Within last 24h
174
+
175
+ await userProfiles.updateProfile(profile.handle, {
176
+ building: profile.building,
177
+ interests: profile.interests,
178
+ tags: profile.tags,
179
+ lastSeen: lastSeen,
180
+ firstSeen: lastSeen - Math.random() * 7 * 24 * 60 * 60 * 1000, // Within last week
181
+ mock: true
182
+ });
183
+
184
+ results.created++;
185
+ } catch (error) {
186
+ results.errors.push(`Failed to create ${profile.handle}: ${error.message}`);
187
+ }
188
+ }
189
+
190
+ // Create skill exchange posts
191
+ for (const exchange of sampleSkillExchanges.slice(0, count / 2)) {
192
+ try {
193
+ const post = {
194
+ id: Date.now() + Math.random(),
195
+ handle: exchange.handle,
196
+ type: exchange.type,
197
+ skill: exchange.skill,
198
+ details: exchange.details,
199
+ category: exchange.category,
200
+ timestamp: Date.now() - Math.random() * 12 * 60 * 60 * 1000, // Within last 12h
201
+ status: 'active',
202
+ mock: true
203
+ };
204
+
205
+ await store.appendSkillExchange(post);
206
+ results.exchanges++;
207
+ } catch (error) {
208
+ results.errors.push(`Failed to create skill exchange: ${error.message}`);
209
+ }
210
+ }
211
+
212
+ } catch (error) {
213
+ results.errors.push(`Bootstrap error: ${error.message}`);
214
+ }
215
+
216
+ return results;
217
+ }
218
+
219
+ async function handler(args) {
220
+ const initCheck = requireInit();
221
+ if (initCheck) return initCheck;
222
+
223
+ const count = args.count || 10;
224
+ const clearFirst = args.clear || false;
225
+
226
+ try {
227
+ const results = await createSampleProfiles(count, clearFirst);
228
+
229
+ let display = `## Discovery System Bootstrapped! 🚀\n\n`;
230
+
231
+ display += `**Created:**\n`;
232
+ display += `• ${results.created} sample user profiles\n`;
233
+ display += `• ${results.exchanges} skill exchange posts\n\n`;
234
+
235
+ if (results.errors.length > 0) {
236
+ display += `**Errors:**\n`;
237
+ for (const error of results.errors) {
238
+ display += `• ${error}\n`;
239
+ }
240
+ display += `\n`;
241
+ }
242
+
243
+ display += `**Now try:**\n`;
244
+ display += `• \`workshop-buddy find\` — Find your ideal workshop partner\n`;
245
+ display += `• \`skills-exchange browse\` — Browse the skill marketplace\n`;
246
+ display += `• \`discover suggest\` — Get personalized recommendations\n`;
247
+ display += `• \`discover interests\` — Browse by interest categories\n\n`;
248
+
249
+ display += `**Sample profiles include:**\n`;
250
+ display += `• Frontend + Backend developers (complementary skills)\n`;
251
+ display += `• Designers seeking engineering help\n`;
252
+ display += `• AI engineers needing product guidance\n`;
253
+ display += `• Mobile developers wanting UI expertise\n`;
254
+ display += `• DevOps + Security specialists\n\n`;
255
+
256
+ display += `_These are mock profiles for testing. Real users will have richer, authentic profiles._`;
257
+
258
+ return { display };
259
+
260
+ } catch (error) {
261
+ return {
262
+ display: `## Bootstrap Error\n\n${error.message}\n\nTry: \`discovery-bootstrap --count 5\``
263
+ };
264
+ }
265
+ }
266
+
267
+ module.exports = { definition, handler };
@@ -0,0 +1,375 @@
1
+ /**
2
+ * Discovery Daily — Daily discovery routine and community health check
3
+ *
4
+ * Automated daily tasks:
5
+ * - Welcome new users with connection suggestions
6
+ * - Identify high-value connection opportunities
7
+ * - Generate community insights
8
+ * - Clean up old data
9
+ * - Update trending interests/tags
10
+ */
11
+
12
+ const config = require('../config');
13
+ const userProfiles = require('../store/profiles');
14
+ const discoveryMonitor = require('./discovery-monitor');
15
+ const { suggest_connection, dm_user } = require('./_actions');
16
+ const { formatTimeAgo, requireInit } = require('./_shared');
17
+
18
+ const definition = {
19
+ name: 'vibe_discovery_daily',
20
+ description: 'Run daily discovery routines and community health checks.',
21
+ inputSchema: {
22
+ type: 'object',
23
+ properties: {
24
+ action: {
25
+ type: 'string',
26
+ enum: ['full', 'welcome', 'insights', 'cleanup'],
27
+ description: 'Which daily routine to run'
28
+ }
29
+ }
30
+ }
31
+ };
32
+
33
+ // Full daily routine
34
+ async function runFullDaily() {
35
+ const results = {
36
+ welcomesSent: 0,
37
+ connectionsSuggested: 0,
38
+ insights: {},
39
+ cleanedProfiles: 0,
40
+ errors: []
41
+ };
42
+
43
+ try {
44
+ // 1. Welcome new users
45
+ const welcomeResults = await welcomeNewUsers();
46
+ results.welcomesSent = welcomeResults.welcomesSent;
47
+ results.connectionsSuggested += welcomeResults.connectionsSuggested;
48
+
49
+ // 2. Find high-value connections
50
+ const opportunityResults = await findTodaysOpportunities();
51
+ results.connectionsSuggested += opportunityResults.suggested;
52
+
53
+ // 3. Generate insights
54
+ results.insights = await generateDailyInsights();
55
+
56
+ // 4. Cleanup old data
57
+ results.cleanedProfiles = await userProfiles.cleanupOldProfiles(30);
58
+
59
+ return results;
60
+ } catch (error) {
61
+ results.errors.push(error.message);
62
+ return results;
63
+ }
64
+ }
65
+
66
+ // Welcome new users with connection suggestions
67
+ async function welcomeNewUsers() {
68
+ const newUsers = await discoveryMonitor.getRecentUsers(24);
69
+ let welcomesSent = 0;
70
+ let connectionsSuggested = 0;
71
+
72
+ for (const user of newUsers) {
73
+ try {
74
+ // Get welcome connections for this user
75
+ const welcomeConnections = await discoveryMonitor.getWelcomeConnections(user.handle);
76
+
77
+ if (welcomeConnections.length > 0) {
78
+ // Send welcome message with suggestions
79
+ const welcomeMsg = createWelcomeMessage(user, welcomeConnections);
80
+ await dm_user(user.handle, welcomeMsg);
81
+ welcomesSent++;
82
+
83
+ // Make connection suggestions (max 2 per new user)
84
+ for (const connection of welcomeConnections.slice(0, 2)) {
85
+ await suggest_connection(user.handle, connection.handle, connection.reason);
86
+ connectionsSuggested++;
87
+ }
88
+ } else {
89
+ // Send basic welcome if no specific connections found
90
+ const basicWelcome = createBasicWelcome(user);
91
+ await dm_user(user.handle, basicWelcome);
92
+ welcomesSent++;
93
+ }
94
+ } catch (error) {
95
+ console.warn(`Failed to welcome ${user.handle}:`, error.message);
96
+ }
97
+ }
98
+
99
+ return { welcomesSent, connectionsSuggested };
100
+ }
101
+
102
+ // Create personalized welcome message
103
+ function createWelcomeMessage(user, connections) {
104
+ let msg = `Welcome to /vibe, @${user.handle}! 🎉\n\n`;
105
+
106
+ if (user.building) {
107
+ msg += `I see you're building ${user.building} — that's exciting!\n\n`;
108
+ }
109
+
110
+ if (connections.length > 0) {
111
+ msg += `I found some people you should definitely meet:\n\n`;
112
+
113
+ for (const conn of connections.slice(0, 2)) {
114
+ msg += `**@${conn.handle}** — ${conn.reason}\n`;
115
+ if (conn.building) {
116
+ msg += `Building: ${conn.building}\n`;
117
+ }
118
+ msg += `\n`;
119
+ }
120
+
121
+ msg += `Type \`message @handle\` to reach out, or \`discover suggest\` to see more recommendations.\n\n`;
122
+ }
123
+
124
+ msg += `**Getting started:**\n`;
125
+ msg += `• Share what you're building: \`update building "your project"\`\n`;
126
+ msg += `• Add interests: \`update interests "ai, startups, music"\`\n`;
127
+ msg += `• Tag your skills: \`update tags "frontend, react, python"\`\n\n`;
128
+ msg += `The more you share, the better connections I can suggest!\n\n`;
129
+ msg += `Happy building! 🚀`;
130
+
131
+ return msg;
132
+ }
133
+
134
+ // Create basic welcome for users without specific connections
135
+ function createBasicWelcome(user) {
136
+ let msg = `Welcome to /vibe, @${user.handle}! 🎉\n\n`;
137
+
138
+ msg += `You're joining a community of builders and makers. Here's how to get connected:\n\n`;
139
+
140
+ msg += `**Set up your profile:**\n`;
141
+ msg += `• \`update building "what you're working on"\`\n`;
142
+ msg += `• \`update interests "ai, startups, design"\`\n`;
143
+ msg += `• \`update tags "frontend, python, entrepreneur"\`\n\n`;
144
+
145
+ msg += `**Find your people:**\n`;
146
+ msg += `• \`discover suggest\` — Get personalized recommendations\n`;
147
+ msg += `• \`discover search "ai"\` — Find people by interest\n`;
148
+ msg += `• \`who\` — See who's online now\n\n`;
149
+
150
+ msg += `**Share your work:**\n`;
151
+ msg += `• \`ship "what you completed"\` — Celebrate your progress\n`;
152
+ msg += `• Join the daily builds in \`/vibe\` channel\n\n`;
153
+
154
+ msg += `Looking forward to seeing what you build! 🚀`;
155
+
156
+ return msg;
157
+ }
158
+
159
+ // Find high-value connection opportunities for today
160
+ async function findTodaysOpportunities() {
161
+ const opportunities = await discoveryMonitor.monitorHighValueConnections();
162
+ let suggested = 0;
163
+
164
+ for (const opp of opportunities) {
165
+ try {
166
+ // Suggest the connection to both users
167
+ await suggest_connection(opp.user1, opp.user2, opp.reason);
168
+ suggested++;
169
+
170
+ // Optional: Send a DM to highlight the opportunity
171
+ if (opp.urgency === 'both-online') {
172
+ const msg = `Perfect timing! @${opp.user2} is online now and ${opp.reason.toLowerCase()}. ` +
173
+ `Might be a great time to connect! 🎯`;
174
+ await dm_user(opp.user1, msg);
175
+ }
176
+ } catch (error) {
177
+ console.warn(`Failed to suggest ${opp.user1} -> ${opp.user2}:`, error.message);
178
+ }
179
+ }
180
+
181
+ return { suggested };
182
+ }
183
+
184
+ // Generate daily community insights
185
+ async function generateDailyInsights() {
186
+ const stats = await discoveryMonitor.getConnectionStats();
187
+ const trendingInterests = await userProfiles.getTrendingInterests();
188
+ const trendingTags = await userProfiles.getTrendingTags();
189
+
190
+ const insights = {
191
+ growth: {
192
+ newUsers: stats.newUsersToday,
193
+ activeUsers: stats.activeUsersToday,
194
+ totalUsers: stats.totalUsers,
195
+ connectionsMade: stats.connectionsMadeToday
196
+ },
197
+ engagement: {
198
+ usersWithConnections: stats.usersWithConnections,
199
+ avgConnectionsPerUser: stats.avgConnectionsPerUser.toFixed(1),
200
+ connectionRate: ((stats.usersWithConnections / stats.totalUsers) * 100).toFixed(1)
201
+ },
202
+ trends: {
203
+ topInterests: trendingInterests.slice(0, 5),
204
+ topTags: trendingTags.slice(0, 8)
205
+ },
206
+ health: calculateCommunityHealth(stats)
207
+ };
208
+
209
+ return insights;
210
+ }
211
+
212
+ // Calculate community health score
213
+ function calculateCommunityHealth(stats) {
214
+ let score = 0;
215
+ const factors = [];
216
+
217
+ // Growth factor (30 points max)
218
+ if (stats.newUsersToday > 0) {
219
+ score += Math.min(stats.newUsersToday * 5, 30);
220
+ factors.push(`${stats.newUsersToday} new users today`);
221
+ }
222
+
223
+ // Activity factor (25 points max)
224
+ const activityRate = stats.totalUsers > 0 ? stats.activeUsersToday / stats.totalUsers : 0;
225
+ score += activityRate * 25;
226
+ if (activityRate > 0.3) factors.push('High daily activity');
227
+
228
+ // Connection factor (25 points max)
229
+ const connectionRate = stats.totalUsers > 0 ? stats.usersWithConnections / stats.totalUsers : 0;
230
+ score += connectionRate * 25;
231
+ if (connectionRate > 0.5) factors.push('Good connection rate');
232
+
233
+ // Engagement factor (20 points max)
234
+ if (stats.connectionsMadeToday > 0) {
235
+ score += Math.min(stats.connectionsMadeToday * 4, 20);
236
+ factors.push(`${stats.connectionsMadeToday} connections made today`);
237
+ }
238
+
239
+ let level = 'Needs attention';
240
+ if (score >= 80) level = 'Thriving';
241
+ else if (score >= 60) level = 'Healthy';
242
+ else if (score >= 40) level = 'Growing';
243
+
244
+ return {
245
+ score: Math.round(score),
246
+ level,
247
+ factors
248
+ };
249
+ }
250
+
251
+ async function handler(args) {
252
+ const initCheck = requireInit();
253
+ if (initCheck) return initCheck;
254
+
255
+ const action = args.action || 'full';
256
+ let display = '';
257
+
258
+ try {
259
+ switch (action) {
260
+ case 'full': {
261
+ display = `## Running Daily Discovery Routine...\n\n`;
262
+ const results = await runFullDaily();
263
+
264
+ display += `**Community Activity:**\n`;
265
+ display += `• New users welcomed: ${results.welcomesSent}\n`;
266
+ display += `• Connections suggested: ${results.connectionsSuggested}\n`;
267
+ if (results.cleanedProfiles > 0) {
268
+ display += `• Inactive profiles cleaned: ${results.cleanedProfiles}\n`;
269
+ }
270
+ display += `\n`;
271
+
272
+ if (results.insights.growth) {
273
+ display += `**Growth Today:**\n`;
274
+ display += `• New users: ${results.insights.growth.newUsers}\n`;
275
+ display += `• Active users: ${results.insights.growth.activeUsers}/${results.insights.growth.totalUsers}\n`;
276
+ display += `• New connections: ${results.insights.growth.connectionsMade}\n`;
277
+ display += `\n`;
278
+ }
279
+
280
+ if (results.insights.health) {
281
+ display += `**Community Health: ${results.insights.health.level}** (${results.insights.health.score}/100)\n`;
282
+ if (results.insights.health.factors.length > 0) {
283
+ display += `${results.insights.health.factors.join(' • ')}\n`;
284
+ }
285
+ display += `\n`;
286
+ }
287
+
288
+ if (results.insights.trends?.topInterests?.length > 0) {
289
+ display += `**Trending Interests:**\n`;
290
+ for (const item of results.insights.trends.topInterests) {
291
+ display += `• ${item.interest} (${item.count})\n`;
292
+ }
293
+ display += `\n`;
294
+ }
295
+
296
+ if (results.errors.length > 0) {
297
+ display += `**Errors:**\n`;
298
+ for (const error of results.errors) {
299
+ display += `• ${error}\n`;
300
+ }
301
+ }
302
+
303
+ break;
304
+ }
305
+
306
+ case 'welcome': {
307
+ const results = await welcomeNewUsers();
308
+ display = `## Welcome Routine Complete\n\n`;
309
+ display += `• Users welcomed: ${results.welcomesSent}\n`;
310
+ display += `• Connection suggestions made: ${results.connectionsSuggested}\n`;
311
+ break;
312
+ }
313
+
314
+ case 'insights': {
315
+ const insights = await generateDailyInsights();
316
+ display = `## Daily Community Insights\n\n`;
317
+
318
+ display += `**Growth:**\n`;
319
+ display += `• Total users: ${insights.growth.totalUsers}\n`;
320
+ display += `• New today: ${insights.growth.newUsers}\n`;
321
+ display += `• Active today: ${insights.growth.activeUsers}\n`;
322
+ display += `• Connections made: ${insights.growth.connectionsMade}\n\n`;
323
+
324
+ display += `**Health: ${insights.health.level}** (${insights.health.score}/100)\n`;
325
+ if (insights.health.factors.length > 0) {
326
+ display += `${insights.health.factors.join(' • ')}\n`;
327
+ }
328
+ display += `\n`;
329
+
330
+ if (insights.trends.topInterests.length > 0) {
331
+ display += `**Top Interests:**\n`;
332
+ for (const item of insights.trends.topInterests) {
333
+ display += `• ${item.interest} (${item.count})\n`;
334
+ }
335
+ }
336
+
337
+ break;
338
+ }
339
+
340
+ case 'cleanup': {
341
+ const cleaned = await userProfiles.cleanupOldProfiles(30);
342
+ display = `## Cleanup Complete\n\n`;
343
+ display += `Removed ${cleaned} inactive profiles (30+ days old)\n`;
344
+ break;
345
+ }
346
+
347
+ default:
348
+ display = `## Discovery Daily Commands
349
+
350
+ **\`daily full\`** — Run complete daily routine
351
+ **\`daily welcome\`** — Welcome new users only
352
+ **\`daily insights\`** — Generate community insights
353
+ **\`daily cleanup\`** — Clean up old profiles
354
+
355
+ **Automated daily tasks:**
356
+ • Welcome new users with connection suggestions
357
+ • Find high-value connection opportunities
358
+ • Generate community health insights
359
+ • Clean up inactive profiles`;
360
+ }
361
+ } catch (error) {
362
+ display = `## Daily Routine Error
363
+
364
+ ${error.message}
365
+
366
+ Try running individual routines:
367
+ • \`daily welcome\` — Welcome new users
368
+ • \`daily insights\` — Community insights
369
+ • \`daily cleanup\` — Profile cleanup`;
370
+ }
371
+
372
+ return { display };
373
+ }
374
+
375
+ module.exports = { definition, handler };