slashvibe-mcp 0.3.21 → 0.3.23

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 (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +280 -47
  3. package/auto-update.js +10 -15
  4. package/config.js +36 -31
  5. package/crypto.js +1 -6
  6. package/debug.js +12 -0
  7. package/discord.js +19 -19
  8. package/eslint.config.js +54 -0
  9. package/index.js +217 -207
  10. package/intelligence/index.js +2 -9
  11. package/intelligence/infer.js +10 -16
  12. package/intelligence/patterns.js +23 -18
  13. package/intelligence/proactive.js +16 -15
  14. package/intelligence/serendipity.js +57 -20
  15. package/memory.js +13 -8
  16. package/migrate-v2.js +72 -0
  17. package/notification-emitter.js +2 -2
  18. package/notify.js +39 -14
  19. package/package.json +28 -29
  20. package/post-install.js +141 -0
  21. package/presence.js +2 -2
  22. package/prompts.js +5 -9
  23. package/protocol/index.js +123 -87
  24. package/protocol/telegram-commands.js +36 -37
  25. package/store/api.js +358 -529
  26. package/store/local.js +9 -10
  27. package/store/profiles.js +48 -192
  28. package/store/reservations.js +2 -9
  29. package/store/skills.js +69 -71
  30. package/store/sqlite.js +355 -0
  31. package/test-skills-bootstrap.js +20 -0
  32. package/test-v2-integration.js +385 -0
  33. package/tools/_actions.js +48 -387
  34. package/tools/_connection-queue.js +45 -56
  35. package/tools/_discovery-enhanced.js +52 -57
  36. package/tools/_discovery.js +87 -185
  37. package/tools/{l2-status.js → _experimental/l2-status.js} +68 -70
  38. package/tools/{shipback.js → _experimental/shipback.js} +4 -3
  39. package/tools/_proactive-discovery.js +60 -73
  40. package/tools/_shared/index.js +41 -64
  41. package/tools/admin-inbox.js +10 -15
  42. package/tools/agents.js +1 -1
  43. package/tools/artifact-create.js +13 -23
  44. package/tools/artifact-view.js +4 -4
  45. package/tools/{_deprecated/back.js → back.js} +1 -1
  46. package/tools/bye.js +3 -5
  47. package/tools/consent.js +2 -2
  48. package/tools/context.js +9 -10
  49. package/tools/crossword.js +3 -2
  50. package/tools/discover.js +94 -356
  51. package/tools/dm.js +27 -86
  52. package/tools/doctor.js +12 -41
  53. package/tools/drawing.js +34 -20
  54. package/tools/echo.js +11 -11
  55. package/tools/feed.js +30 -58
  56. package/tools/follow.js +64 -187
  57. package/tools/{_deprecated/forget.js → forget.js} +4 -7
  58. package/tools/game.js +144 -48
  59. package/tools/handoff.js +6 -8
  60. package/tools/help.js +3 -3
  61. package/tools/idea.js +15 -27
  62. package/tools/inbox.js +121 -293
  63. package/tools/init.js +54 -151
  64. package/tools/invite.js +8 -21
  65. package/tools/migrate.js +27 -24
  66. package/tools/multiplayer-game.js +50 -40
  67. package/tools/{_deprecated/mute.js → mute.js} +4 -3
  68. package/tools/notifications.js +58 -48
  69. package/tools/observe.js +12 -15
  70. package/tools/onboarding.js +8 -11
  71. package/tools/open.js +13 -144
  72. package/tools/party-game.js +23 -12
  73. package/tools/patterns.js +2 -1
  74. package/tools/ping.js +5 -7
  75. package/tools/react.js +28 -30
  76. package/tools/{_deprecated/recall.js → recall.js} +5 -10
  77. package/tools/release.js +4 -2
  78. package/tools/{_deprecated/remember.js → remember.js} +4 -6
  79. package/tools/report.js +2 -2
  80. package/tools/request.js +6 -26
  81. package/tools/reserve.js +1 -1
  82. package/tools/session-fork.js +97 -0
  83. package/tools/session-save.js +109 -0
  84. package/tools/settings.js +30 -99
  85. package/tools/ship.js +74 -56
  86. package/tools/{_deprecated/skills-exchange.js → skills-exchange.js} +38 -39
  87. package/tools/social-inbox.js +22 -28
  88. package/tools/social-post.js +24 -27
  89. package/tools/solo-game.js +54 -46
  90. package/tools/start.js +14 -148
  91. package/tools/status.js +21 -68
  92. package/tools/submit.js +4 -2
  93. package/tools/suggest-tags.js +36 -33
  94. package/tools/summarize.js +19 -16
  95. package/tools/tag-suggestions.js +72 -73
  96. package/tools/test.js +1 -1
  97. package/tools/{_deprecated/tictactoe.js → tictactoe.js} +26 -26
  98. package/tools/token.js +4 -4
  99. package/tools/update.js +1 -2
  100. package/tools/watch.js +132 -112
  101. package/tools/who.js +20 -40
  102. package/tools/{_deprecated/wordassociation.js → wordassociation.js} +23 -20
  103. package/tools/workshop-buddy.js +52 -53
  104. package/tools/x-mentions.js +0 -1
  105. package/tools/x-reply.js +0 -1
  106. package/twitter.js +14 -20
  107. package/version.json +8 -10
  108. package/webhook-runner.js +132 -0
  109. package/auth-store.js +0 -148
  110. package/bridges/bridge-monitor.js +0 -388
  111. package/bridges/discord-bot.js +0 -431
  112. package/bridges/farcaster.js +0 -299
  113. package/bridges/telegram.js +0 -261
  114. package/bridges/webhook-health.js +0 -420
  115. package/bridges/webhook-server.js +0 -437
  116. package/bridges/whatsapp.js +0 -441
  117. package/bridges/x-webhook.js +0 -423
  118. package/games/arcade.js +0 -406
  119. package/games/chess.js +0 -451
  120. package/games/colorguess.js +0 -343
  121. package/games/crossword-words.js +0 -171
  122. package/games/crossword.js +0 -461
  123. package/games/drawing.js +0 -347
  124. package/games/gameroulette.js +0 -300
  125. package/games/gamerouter.js +0 -336
  126. package/games/gamestatus.js +0 -337
  127. package/games/guessnumber.js +0 -209
  128. package/games/hangman.js +0 -279
  129. package/games/memory.js +0 -338
  130. package/games/multiplayer-tictactoe.js +0 -389
  131. package/games/pixelart.js +0 -399
  132. package/games/quickduel.js +0 -354
  133. package/games/riddle.js +0 -371
  134. package/games/rockpaperscissors.js +0 -291
  135. package/games/snake.js +0 -406
  136. package/games/storybuilder.js +0 -343
  137. package/games/tictactoe.js +0 -345
  138. package/games/twentyquestions.js +0 -286
  139. package/games/twotruths.js +0 -207
  140. package/games/werewolf.js +0 -508
  141. package/games/wordassociation.js +0 -247
  142. package/games/wordchain.js +0 -135
  143. package/intelligence/interests.js +0 -369
  144. package/setup.js +0 -480
  145. package/smart-inbox.js +0 -276
  146. package/tools/_deprecated/auto-suggest-connections.js +0 -304
  147. package/tools/_deprecated/bootstrap-skills.js +0 -231
  148. package/tools/_deprecated/bridge-dashboard.js +0 -342
  149. package/tools/_deprecated/bridge-health.js +0 -400
  150. package/tools/_deprecated/bridge-live.js +0 -384
  151. package/tools/_deprecated/bridges.js +0 -383
  152. package/tools/_deprecated/colorguess.js +0 -281
  153. package/tools/_deprecated/discover-insights.js +0 -379
  154. package/tools/_deprecated/discover-momentum.js +0 -256
  155. package/tools/_deprecated/discovery-analytics.js +0 -345
  156. package/tools/_deprecated/discovery-auto-suggest.js +0 -275
  157. package/tools/_deprecated/discovery-bootstrap.js +0 -267
  158. package/tools/_deprecated/discovery-daily.js +0 -375
  159. package/tools/_deprecated/discovery-dashboard.js +0 -385
  160. package/tools/_deprecated/discovery-digest.js +0 -314
  161. package/tools/_deprecated/discovery-hub.js +0 -357
  162. package/tools/_deprecated/discovery-insights.js +0 -384
  163. package/tools/_deprecated/discovery-momentum.js +0 -281
  164. package/tools/_deprecated/discovery-monitor.js +0 -319
  165. package/tools/_deprecated/discovery-proactive.js +0 -300
  166. package/tools/_deprecated/draw.js +0 -317
  167. package/tools/_deprecated/farcaster.js +0 -307
  168. package/tools/_deprecated/games-catalog.js +0 -376
  169. package/tools/_deprecated/games.js +0 -313
  170. package/tools/_deprecated/guessnumber.js +0 -194
  171. package/tools/_deprecated/hangman.js +0 -129
  172. package/tools/_deprecated/multiplayer-tictactoe.js +0 -303
  173. package/tools/_deprecated/riddle.js +0 -240
  174. package/tools/_deprecated/run-bootstrap.js +0 -69
  175. package/tools/_deprecated/skills-analytics.js +0 -349
  176. package/tools/_deprecated/skills-bootstrap.js +0 -301
  177. package/tools/_deprecated/skills-dashboard.js +0 -268
  178. package/tools/_deprecated/skills.js +0 -380
  179. package/tools/_deprecated/smart-intro.js +0 -353
  180. package/tools/_deprecated/storybuilder.js +0 -331
  181. package/tools/_deprecated/telegram-bot.js +0 -183
  182. package/tools/_deprecated/telegram-setup.js +0 -214
  183. package/tools/_deprecated/twentyquestions.js +0 -143
  184. package/tools/_shared.js +0 -234
  185. package/tools/_work-context.js +0 -338
  186. package/tools/_work-context.manual-test.js +0 -199
  187. package/tools/_work-context.test.js +0 -260
  188. package/tools/activity.js +0 -220
  189. package/tools/agent-treasury.js +0 -288
  190. package/tools/analytics.js +0 -191
  191. package/tools/approve.js +0 -197
  192. package/tools/arcade.js +0 -173
  193. package/tools/artifacts-price.js +0 -107
  194. package/tools/ask-expert.js +0 -160
  195. package/tools/available.js +0 -120
  196. package/tools/become-expert.js +0 -150
  197. package/tools/broadcast.js +0 -325
  198. package/tools/chat.js +0 -202
  199. package/tools/collaborative-drawing.js +0 -286
  200. package/tools/connection-status.js +0 -178
  201. package/tools/earnings.js +0 -126
  202. package/tools/friends.js +0 -207
  203. package/tools/genesis.js +0 -233
  204. package/tools/gig-browse.js +0 -206
  205. package/tools/gig-complete.js +0 -144
  206. package/tools/health.js +0 -87
  207. package/tools/leaderboard.js +0 -117
  208. package/tools/lib/git-apply.js +0 -206
  209. package/tools/lib/git-bundle.js +0 -407
  210. package/tools/mint.js +0 -377
  211. package/tools/plan.js +0 -225
  212. package/tools/profile.js +0 -219
  213. package/tools/proof-of-work.js +0 -144
  214. package/tools/pulse.js +0 -218
  215. package/tools/reply.js +0 -166
  216. package/tools/reputation.js +0 -175
  217. package/tools/schedule.js +0 -367
  218. package/tools/search-messages.js +0 -123
  219. package/tools/session.js +0 -467
  220. package/tools/session_price.js +0 -128
  221. package/tools/smart-check.js +0 -201
  222. package/tools/social-processor.js +0 -445
  223. package/tools/streak.js +0 -147
  224. package/tools/stuck.js +0 -297
  225. package/tools/subscribe.js +0 -148
  226. package/tools/subscriptions.js +0 -134
  227. package/tools/tip.js +0 -193
  228. package/tools/wallet.js +0 -269
  229. package/tools/webhook-test.js +0 -388
  230. package/tools/withdraw.js +0 -145
  231. package/tools/work-summary.js +0 -96
  232. package/tools/workshop.js +0 -327
  233. /package/tools/{l2-bridge.js → _experimental/l2-bridge.js} +0 -0
  234. /package/tools/{l2.js → _experimental/l2.js} +0 -0
  235. /package/tools/{_deprecated/away.js → away.js} +0 -0
@@ -1,376 +0,0 @@
1
- /**
2
- * vibe games — Discover and launch all available games on /vibe
3
- *
4
- * Your one-stop shop for finding fun! Browse all games, get recommendations,
5
- * and quick-launch your favorites.
6
- */
7
-
8
- const config = require('../config');
9
- const { requireInit } = require('./_shared');
10
-
11
- const definition = {
12
- name: 'vibe_games',
13
- description: 'Discover all available games on /vibe. Browse catalog, get recommendations, quick-launch games.',
14
- inputSchema: {
15
- type: 'object',
16
- properties: {
17
- category: {
18
- type: 'string',
19
- description: 'Filter by game category',
20
- enum: ['all', 'solo', 'multiplayer', 'collaborative', 'party', 'creative']
21
- },
22
- players: {
23
- type: 'number',
24
- description: 'Filter by number of players (1 for solo, 2+ for multiplayer)'
25
- },
26
- mood: {
27
- type: 'string',
28
- description: 'Get game recommendations based on your mood',
29
- enum: ['competitive', 'creative', 'chill', 'brainy', 'social']
30
- }
31
- },
32
- required: []
33
- }
34
- };
35
-
36
- // Games catalog with all available games
37
- const GAMES_CATALOG = {
38
- // Solo Games
39
- solo: [
40
- {
41
- name: '20 Questions',
42
- command: 'vibe twenty-questions',
43
- description: 'I think of something, you guess with yes/no questions',
44
- emoji: '❓',
45
- difficulty: 'medium',
46
- playtime: '5-10 min',
47
- tags: ['brainy', 'solo', 'guessing']
48
- },
49
- {
50
- name: 'Riddles',
51
- command: 'vibe riddle',
52
- description: 'Challenge your mind with brain teasers across difficulty levels',
53
- emoji: '🧩',
54
- difficulty: 'varies',
55
- playtime: '3-15 min',
56
- tags: ['brainy', 'solo', 'puzzle']
57
- },
58
- {
59
- name: 'Hangman',
60
- command: 'vibe hangman',
61
- description: 'Classic word guessing game - can you save the stick figure?',
62
- emoji: '🎪',
63
- difficulty: 'easy',
64
- playtime: '5 min',
65
- tags: ['casual', 'solo', 'word']
66
- },
67
- {
68
- name: 'Number Guessing',
69
- command: 'vibe guessnumber',
70
- description: 'Guess my number between 1-100 with strategic hints',
71
- emoji: '🔢',
72
- difficulty: 'easy',
73
- playtime: '3-5 min',
74
- tags: ['casual', 'solo', 'logic']
75
- }
76
- ],
77
-
78
- // 1v1 Games
79
- versus: [
80
- {
81
- name: 'Tic-Tac-Toe',
82
- command: 'vibe game @friend',
83
- description: 'Classic 3x3 grid strategy - get three in a row!',
84
- emoji: '⭕',
85
- players: 2,
86
- difficulty: 'easy',
87
- playtime: '2 min',
88
- tags: ['competitive', '1v1', 'classic']
89
- },
90
- {
91
- name: 'Chess',
92
- command: 'vibe game @friend --game chess',
93
- description: 'The timeless strategy game with full piece movement',
94
- emoji: '♟️',
95
- players: 2,
96
- difficulty: 'hard',
97
- playtime: '10-60 min',
98
- tags: ['competitive', '1v1', 'strategy']
99
- },
100
- {
101
- name: 'Rock Paper Scissors',
102
- command: 'vibe rockpaperscissors @friend',
103
- description: 'Quick decision game of chance and psychology',
104
- emoji: '✂️',
105
- players: 2,
106
- difficulty: 'easy',
107
- playtime: '1 min',
108
- tags: ['competitive', '1v1', 'quick']
109
- }
110
- ],
111
-
112
- // Collaborative & Creative Games
113
- collaborative: [
114
- {
115
- name: 'Collaborative Drawing',
116
- command: 'vibe drawing --action start',
117
- description: '🎨 Real-time shared canvas! Draw together with emojis and Unicode art',
118
- emoji: '🎨',
119
- players: '1-8',
120
- difficulty: 'easy',
121
- playtime: '10-30 min',
122
- tags: ['creative', 'collaborative', 'art', 'realtime']
123
- },
124
- {
125
- name: 'Story Builder',
126
- command: 'vibe story-builder --action create',
127
- description: '📖 Build stories together! Each person adds one sentence',
128
- emoji: '📖',
129
- players: '1-8',
130
- difficulty: 'easy',
131
- playtime: '15-30 min',
132
- tags: ['creative', 'collaborative', 'writing', 'storytelling']
133
- }
134
- ],
135
-
136
- // Multiplayer Party Games
137
- party: [
138
- {
139
- name: 'Word Association',
140
- command: 'vibe multiplayer-game wordassociation --action create',
141
- description: 'Say words that relate to the previous word. Build themes together!',
142
- emoji: '💭',
143
- players: '2-6',
144
- difficulty: 'easy',
145
- playtime: '10-20 min',
146
- tags: ['social', 'party', 'word', 'creative']
147
- },
148
- {
149
- name: 'Werewolf',
150
- command: 'vibe werewolf --action create',
151
- description: 'Social deduction party game - find the werewolves!',
152
- emoji: '🐺',
153
- players: '5-12',
154
- difficulty: 'medium',
155
- playtime: '20-45 min',
156
- tags: ['social', 'party', 'deduction', 'strategy']
157
- },
158
- {
159
- name: 'Two Truths and a Lie',
160
- command: 'vibe twotruths',
161
- description: 'Share facts about yourself - others guess which is the lie',
162
- emoji: '🤥',
163
- players: '3+',
164
- difficulty: 'easy',
165
- playtime: '10-20 min',
166
- tags: ['social', 'party', 'icebreaker']
167
- }
168
- ]
169
- };
170
-
171
- // Mood-based game recommendations
172
- const MOOD_RECOMMENDATIONS = {
173
- competitive: ['Chess', 'Tic-Tac-Toe', 'Rock Paper Scissors', 'Werewolf'],
174
- creative: ['Collaborative Drawing', 'Story Builder', 'Word Association'],
175
- chill: ['20 Questions', 'Hangman', 'Number Guessing', 'Two Truths and a Lie'],
176
- brainy: ['Riddles', '20 Questions', 'Chess', 'Werewolf'],
177
- social: ['Word Association', 'Story Builder', 'Werewolf', 'Two Truths and a Lie', 'Collaborative Drawing']
178
- };
179
-
180
- // Quick stats about the game ecosystem
181
- function getGameStats() {
182
- const allGames = Object.values(GAMES_CATALOG).flat();
183
- const totalGames = allGames.length;
184
-
185
- const byCategory = {};
186
- const byPlayers = { solo: 0, duo: 0, party: 0 };
187
-
188
- Object.entries(GAMES_CATALOG).forEach(([category, games]) => {
189
- byCategory[category] = games.length;
190
- });
191
-
192
- allGames.forEach(game => {
193
- if (!game.players || game.players === 1) {
194
- byPlayers.solo++;
195
- } else if (game.players === 2) {
196
- byPlayers.duo++;
197
- } else {
198
- byPlayers.party++;
199
- }
200
- });
201
-
202
- return { totalGames, byCategory, byPlayers };
203
- }
204
-
205
- // Format games display
206
- function formatGamesDisplay(games, title, showCommands = true) {
207
- if (games.length === 0) {
208
- return `**${title}**\nNo games found matching your criteria.`;
209
- }
210
-
211
- let display = `## ${title}\n\n`;
212
-
213
- for (const game of games) {
214
- display += `### ${game.emoji} ${game.name}\n`;
215
- display += `${game.description}\n\n`;
216
-
217
- // Game details
218
- const details = [];
219
- if (game.players) details.push(`👥 ${game.players} players`);
220
- if (game.difficulty) details.push(`🎯 ${game.difficulty}`);
221
- if (game.playtime) details.push(`⏱️ ${game.playtime}`);
222
-
223
- if (details.length > 0) {
224
- display += `**Details:** ${details.join(' • ')}\n`;
225
- }
226
-
227
- if (showCommands) {
228
- display += `**Play:** \`${game.command}\`\n\n`;
229
- } else {
230
- display += '\n';
231
- }
232
- }
233
-
234
- return display;
235
- }
236
-
237
- // Get games by category
238
- function getGamesByCategory(category) {
239
- if (category === 'all') {
240
- return Object.values(GAMES_CATALOG).flat();
241
- }
242
-
243
- const categoryMap = {
244
- 'solo': 'solo',
245
- 'multiplayer': ['versus', 'party'],
246
- 'collaborative': 'collaborative',
247
- 'party': 'party',
248
- 'creative': 'collaborative' // Alias for collaborative
249
- };
250
-
251
- const targetCategories = Array.isArray(categoryMap[category]) ?
252
- categoryMap[category] : [categoryMap[category]];
253
-
254
- const games = [];
255
- for (const cat of targetCategories) {
256
- if (GAMES_CATALOG[cat]) {
257
- games.push(...GAMES_CATALOG[cat]);
258
- }
259
- }
260
-
261
- return games;
262
- }
263
-
264
- // Get games by player count
265
- function getGamesByPlayers(playerCount) {
266
- const allGames = Object.values(GAMES_CATALOG).flat();
267
-
268
- return allGames.filter(game => {
269
- if (!game.players) return playerCount === 1; // Solo games
270
-
271
- const players = game.players;
272
-
273
- // Handle ranges like "2-6" or "3+"
274
- if (typeof players === 'string') {
275
- if (players.includes('-')) {
276
- const [min, max] = players.split('-').map(n => parseInt(n));
277
- return playerCount >= min && playerCount <= max;
278
- } else if (players.includes('+')) {
279
- const min = parseInt(players.replace('+', ''));
280
- return playerCount >= min;
281
- }
282
- return parseInt(players) === playerCount;
283
- }
284
-
285
- return players === playerCount;
286
- });
287
- }
288
-
289
- // Get mood-based recommendations
290
- function getMoodRecommendations(mood) {
291
- const gameNames = MOOD_RECOMMENDATIONS[mood] || [];
292
- const allGames = Object.values(GAMES_CATALOG).flat();
293
-
294
- return allGames.filter(game => gameNames.includes(game.name));
295
- }
296
-
297
- async function handler(args) {
298
- const initCheck = requireInit();
299
- if (initCheck) return initCheck;
300
-
301
- const { category = 'all', players, mood } = args;
302
-
303
- // Handle mood-based recommendations
304
- if (mood) {
305
- const games = getMoodRecommendations(mood);
306
- const title = `🎮 Games for ${mood.toUpperCase()} mood`;
307
- return {
308
- display: formatGamesDisplay(games, title)
309
- };
310
- }
311
-
312
- // Handle player count filter
313
- if (players) {
314
- const games = getGamesByPlayers(players);
315
- const title = `🎮 Games for ${players} player${players !== 1 ? 's' : ''}`;
316
- return {
317
- display: formatGamesDisplay(games, title)
318
- };
319
- }
320
-
321
- // Handle category filter
322
- if (category && category !== 'all') {
323
- const games = getGamesByCategory(category);
324
- const title = `🎮 ${category.toUpperCase()} Games`;
325
- return {
326
- display: formatGamesDisplay(games, title)
327
- };
328
- }
329
-
330
- // Show full catalog (default)
331
- const stats = getGameStats();
332
-
333
- let display = `# 🎮 /vibe Games Catalog\n\n`;
334
- display += `Welcome to the /vibe games arcade! We have **${stats.totalGames} games** across multiple categories.\n\n`;
335
-
336
- // Quick stats
337
- display += `**Quick Browse:**\n`;
338
- display += `• 🎯 \`vibe games --category solo\` - ${stats.byCategory.solo} solo games\n`;
339
- display += `• ⚔️ \`vibe games --category versus\` - 1v1 competitive games\n`;
340
- display += `• 🎨 \`vibe games --category collaborative\` - Create together\n`;
341
- display += `• 🎉 \`vibe games --category party\` - Group fun\n\n`;
342
-
343
- display += `**By Mood:**\n`;
344
- display += `• 🏆 \`vibe games --mood competitive\` - Ready to win\n`;
345
- display += `• 🎨 \`vibe games --mood creative\` - Make something cool\n`;
346
- display += `• 😌 \`vibe games --mood chill\` - Relaxed fun\n`;
347
- display += `• 🧠 \`vibe games --mood brainy\` - Mental challenge\n`;
348
- display += `• 👥 \`vibe games --mood social\` - Connect with others\n\n`;
349
-
350
- display += `**By Players:**\n`;
351
- display += `• \`vibe games --players 1\` - Solo adventures\n`;
352
- display += `• \`vibe games --players 2\` - Perfect for pairs\n`;
353
- display += `• \`vibe games --players 4\` - Small group games\n\n`;
354
-
355
- // Highlight featured games
356
- display += `## ⭐ Featured Games\n\n`;
357
-
358
- const featured = [
359
- GAMES_CATALOG.collaborative[0], // Drawing
360
- GAMES_CATALOG.party[0], // Word Association
361
- GAMES_CATALOG.versus[1], // Chess
362
- GAMES_CATALOG.solo[0] // 20 Questions
363
- ];
364
-
365
- for (const game of featured) {
366
- display += `**${game.emoji} ${game.name}** - ${game.description}\n`;
367
- display += `▸ \`${game.command}\`\n\n`;
368
- }
369
-
370
- display += `💡 **Tip:** Many games work great for icebreakers, team building, or just having fun with friends!\n\n`;
371
- display += `Use \`vibe games --category all\` to see the complete catalog with details.`;
372
-
373
- return { display };
374
- }
375
-
376
- module.exports = { definition, handler };
@@ -1,313 +0,0 @@
1
- /**
2
- * vibe games — Browse and launch workshop games
3
- *
4
- * Discover all available games, get recommendations, and launch games
5
- */
6
-
7
- const config = require('../config');
8
- const store = require('../store');
9
- const { createGamePayload, formatPayload } = require('../protocol');
10
- const { requireInit, normalizeHandle } = require('./_shared');
11
-
12
- // Import game systems
13
- const arcade = require('../games/arcade');
14
- const gamerouter = require('../games/gamerouter');
15
-
16
- // Track active game sessions per user
17
- const activeSessions = new Map();
18
-
19
- const definition = {
20
- name: 'vibe_games',
21
- description: 'Browse and launch workshop games. Discover new games, get recommendations, or launch any game.',
22
- inputSchema: {
23
- type: 'object',
24
- properties: {
25
- action: {
26
- type: 'string',
27
- description: 'What to do: browse, launch, suggest, help, status',
28
- enum: ['browse', 'launch', 'suggest', 'help', 'status', 'quit']
29
- },
30
- game: {
31
- type: 'string',
32
- description: 'Game to launch (e.g., hangman, wordchain, drawing)'
33
- },
34
- category: {
35
- type: 'string',
36
- description: 'Game category to browse (classic, word, puzzle, action, creative, social)'
37
- },
38
- difficulty: {
39
- type: 'string',
40
- description: 'Difficulty preference for suggestions (easy, medium, hard)',
41
- enum: ['easy', 'medium', 'hard']
42
- },
43
- players: {
44
- type: 'string',
45
- description: 'Player preference for suggestions (solo, multiplayer)',
46
- enum: ['solo', 'multiplayer']
47
- },
48
- command: {
49
- type: 'string',
50
- description: 'Command to send to active game'
51
- }
52
- },
53
- required: []
54
- }
55
- };
56
-
57
- // Get user session
58
- function getUserSession(handle) {
59
- if (!activeSessions.has(handle)) {
60
- activeSessions.set(handle, {
61
- currentGame: null,
62
- gameState: null,
63
- arcadeState: arcade.createInitialArcadeState(),
64
- lastActivity: new Date().toISOString()
65
- });
66
- }
67
- return activeSessions.get(handle);
68
- }
69
-
70
- // Clear user session
71
- function clearUserSession(handle) {
72
- activeSessions.delete(handle);
73
- }
74
-
75
- // Format game list for display
76
- function formatGameList(games, title = 'Games') {
77
- if (!games || games.length === 0) {
78
- return `**${title}**\n*No games found.*`;
79
- }
80
-
81
- let display = `**${title}** (${games.length} games)\n\n`;
82
-
83
- games.forEach(game => {
84
- display += `${game.icon || '🎮'} **${game.name}**\n`;
85
- display += ` *${game.description}*\n`;
86
- display += ` Players: ${game.players} • Difficulty: ${game.difficulty}\n\n`;
87
- });
88
-
89
- return display;
90
- }
91
-
92
- // Launch a specific game
93
- function launchGame(session, gameId) {
94
- // Check if game exists
95
- if (!gamerouter.gameAvailable(gameId)) {
96
- const availableGames = gamerouter.getAvailableGames();
97
- return {
98
- error: `Game '${gameId}' not found! Available games: ${availableGames.join(', ')}`
99
- };
100
- }
101
-
102
- // Create game state
103
- const result = gamerouter.createGameState(gameId);
104
- if (result.error) {
105
- return { error: result.error };
106
- }
107
-
108
- // Update session
109
- session.currentGame = gameId;
110
- session.gameState = result.gameState;
111
- session.lastActivity = new Date().toISOString();
112
-
113
- // Get display
114
- const display = gamerouter.displayGame(gameId, result.gameState);
115
- const instructions = gamerouter.getQuickStart(gameId);
116
-
117
- return {
118
- success: true,
119
- display: display + '\n\n💡 **Quick Start:** ' + instructions + '\n\n*Use `vibe games --command [action]` to play, or `vibe games --action quit` to exit.*'
120
- };
121
- }
122
-
123
- // Handle game command
124
- function handleGameCommand(session, command) {
125
- if (!session.currentGame || !session.gameState) {
126
- return { error: 'No active game. Use `vibe games --action launch --game [name]` to start a game.' };
127
- }
128
-
129
- const result = gamerouter.handleGameCommand(session.currentGame, session.gameState, command);
130
- if (result.error) {
131
- return { error: result.error };
132
- }
133
-
134
- // Update session
135
- if (result.gameState) {
136
- session.gameState = result.gameState;
137
- session.lastActivity = new Date().toISOString();
138
- }
139
-
140
- // Format response
141
- let display = '';
142
- if (result.display) {
143
- display = result.display;
144
- } else if (result.gameState) {
145
- display = gamerouter.displayGame(session.currentGame, result.gameState);
146
- } else {
147
- display = 'Command processed.';
148
- }
149
-
150
- return { success: true, display: display };
151
- }
152
-
153
- // Generate game recommendations
154
- function getRecommendations(difficulty = 'any', players = 'any') {
155
- const suggestions = gamerouter.getGameSuggestions(players, difficulty);
156
-
157
- let display = '🎯 **Game Recommendations**\n\n';
158
-
159
- if (difficulty !== 'any') {
160
- display += `*${difficulty.charAt(0).toUpperCase() + difficulty.slice(1)} difficulty games*\n`;
161
- }
162
- if (players !== 'any') {
163
- display += `*${players.charAt(0).toUpperCase() + players.slice(1)} games*\n`;
164
- }
165
-
166
- display += '\n';
167
-
168
- const recommendedGames = suggestions.slice(0, 6); // Show top 6 recommendations
169
-
170
- recommendedGames.forEach(game => {
171
- const status = game.available ? '✅' : '🚧';
172
- display += `${status} ${game.icon || '🎮'} **${game.name}** (${game.players})\n`;
173
- display += ` *${game.description}*\n`;
174
- display += ` Launch with: \`vibe games --action launch --game ${game.id}\`\n\n`;
175
- });
176
-
177
- if (suggestions.length > 6) {
178
- display += `*... and ${suggestions.length - 6} more games! Use \`vibe games --action browse\` to see all.*\n`;
179
- }
180
-
181
- return display;
182
- }
183
-
184
- // Generate help text
185
- function generateHelp() {
186
- return `🎮 **Workshop Games Help**
187
-
188
- **Actions:**
189
- • \`vibe games --action browse\` - Browse all available games
190
- • \`vibe games --action browse --category word\` - Browse word games
191
- • \`vibe games --action launch --game hangman\` - Launch hangman game
192
- • \`vibe games --action suggest\` - Get game recommendations
193
- • \`vibe games --action suggest --difficulty easy --players solo\` - Filtered suggestions
194
- • \`vibe games --action status\` - See your current game status
195
- • \`vibe games --action quit\` - Quit current game
196
-
197
- **Game Categories:**
198
- 🎲 classic • 📝 word • 🧩 puzzle • ⚡ action • 🎨 creative • 👥 social
199
-
200
- **While Playing:**
201
- • \`vibe games --command [action]\` - Send command to current game
202
- • Each game has its own commands - check the quick start guide!
203
-
204
- **Popular Games:**
205
- ⭕ tic-tac-toe • 🎯 hangman • 🔗 wordchain • 🎨 drawing • ❓ twentyquestions
206
-
207
- *Type \`vibe games --action browse\` to see all ${gamerouter.getAvailableGames().length} available games!*`;
208
- }
209
-
210
- async function handler(args) {
211
- const initCheck = requireInit();
212
- if (initCheck) return initCheck;
213
-
214
- const { action = 'browse', game, category, difficulty, players, command } = args;
215
- const myHandle = config.getHandle();
216
- const session = getUserSession(myHandle);
217
-
218
- try {
219
- switch (action) {
220
- case 'help':
221
- return { display: generateHelp() };
222
-
223
- case 'browse': {
224
- if (category) {
225
- // Browse specific category using arcade
226
- const result = arcade.navigateToCategory(session.arcadeState, category);
227
- if (result.error) {
228
- return { display: result.error };
229
- }
230
- session.arcadeState = result.gameState;
231
- const display = arcade.formatArcadeDisplay(session.arcadeState);
232
- return { display };
233
- } else {
234
- // Browse all games using arcade
235
- session.arcadeState = arcade.createInitialArcadeState();
236
- const display = arcade.formatArcadeDisplay(session.arcadeState);
237
- return { display };
238
- }
239
- }
240
-
241
- case 'launch': {
242
- if (!game) {
243
- return { display: 'Please specify a game to launch. Use `vibe games --action browse` to see available games.' };
244
- }
245
- return launchGame(session, game);
246
- }
247
-
248
- case 'suggest': {
249
- const display = getRecommendations(difficulty, players);
250
- return { display };
251
- }
252
-
253
- case 'status': {
254
- if (session.currentGame) {
255
- const display = gamerouter.displayGame(session.currentGame, session.gameState);
256
- return {
257
- display: `**Current Game:** ${session.currentGame}\n\n${display}\n\n*Use \`vibe games --command [action]\` to play, or \`vibe games --action quit\` to exit.*`
258
- };
259
- } else {
260
- const totalGames = gamerouter.getAvailableGames().length;
261
- return {
262
- display: `**No Active Game**\n\n🎮 **${totalGames} games available** in the Workshop\n\nUse \`vibe games --action launch --game [name]\` to start a game\nOr \`vibe games --action browse\` to explore all games`
263
- };
264
- }
265
- }
266
-
267
- case 'quit': {
268
- if (session.currentGame) {
269
- const gameName = session.currentGame;
270
- session.currentGame = null;
271
- session.gameState = null;
272
- return { display: `✅ Quit ${gameName}. Use \`vibe games --action browse\` to find another game!` };
273
- } else {
274
- return { display: 'No active game to quit.' };
275
- }
276
- }
277
-
278
- default: {
279
- // If we have a command and active game, handle it
280
- if (command && session.currentGame) {
281
- return handleGameCommand(session, command);
282
- }
283
-
284
- // Default to browse if no specific action
285
- session.arcadeState = arcade.createInitialArcadeState();
286
- const display = arcade.formatArcadeDisplay(session.arcadeState);
287
- return { display };
288
- }
289
- }
290
-
291
- } catch (error) {
292
- console.error('[games] Error:', error);
293
- return { display: `Error: ${error.message}. Try \`vibe games --action help\` for usage.` };
294
- }
295
- }
296
-
297
- // Clean up inactive sessions (called periodically)
298
- function cleanupInactiveSessions() {
299
- const now = Date.now();
300
- const TIMEOUT = 30 * 60 * 1000; // 30 minutes
301
-
302
- for (const [handle, session] of activeSessions.entries()) {
303
- const lastActivity = new Date(session.lastActivity).getTime();
304
- if (now - lastActivity > TIMEOUT) {
305
- activeSessions.delete(handle);
306
- }
307
- }
308
- }
309
-
310
- // Run cleanup every 10 minutes
311
- setInterval(cleanupInactiveSessions, 10 * 60 * 1000);
312
-
313
- module.exports = { definition, handler };