slashvibe-mcp 0.3.20 → 0.3.21

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 (167) hide show
  1. package/README.md +47 -252
  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 +27 -15
  14. package/games/arcade.js +406 -0
  15. package/games/chess.js +451 -0
  16. package/games/colorguess.js +343 -0
  17. package/games/crossword-words.js +171 -0
  18. package/games/crossword.js +461 -0
  19. package/games/drawing.js +347 -0
  20. package/games/gameroulette.js +300 -0
  21. package/games/gamerouter.js +336 -0
  22. package/games/gamestatus.js +337 -0
  23. package/games/guessnumber.js +209 -0
  24. package/games/hangman.js +279 -0
  25. package/games/memory.js +338 -0
  26. package/games/multiplayer-tictactoe.js +389 -0
  27. package/games/pixelart.js +399 -0
  28. package/games/quickduel.js +354 -0
  29. package/games/riddle.js +371 -0
  30. package/games/rockpaperscissors.js +291 -0
  31. package/games/snake.js +406 -0
  32. package/games/storybuilder.js +343 -0
  33. package/games/tictactoe.js +345 -0
  34. package/games/twentyquestions.js +286 -0
  35. package/games/twotruths.js +207 -0
  36. package/games/werewolf.js +508 -0
  37. package/games/wordassociation.js +247 -0
  38. package/games/wordchain.js +135 -0
  39. package/index.js +116 -159
  40. package/intelligence/index.js +9 -2
  41. package/intelligence/interests.js +369 -0
  42. package/notification-emitter.js +77 -0
  43. package/notify.js +5 -1
  44. package/package.json +21 -16
  45. package/prompts.js +1 -1
  46. package/protocol/index.js +73 -0
  47. package/setup.js +480 -0
  48. package/smart-inbox.js +276 -0
  49. package/store/api.js +536 -215
  50. package/store/profiles.js +160 -12
  51. package/tools/_actions.js +362 -21
  52. package/tools/_discovery.js +119 -26
  53. package/tools/_shared/index.js +64 -0
  54. package/tools/_shared.js +234 -0
  55. package/tools/_work-context.js +338 -0
  56. package/tools/_work-context.manual-test.js +199 -0
  57. package/tools/_work-context.test.js +260 -0
  58. package/tools/activity.js +220 -0
  59. package/tools/analytics.js +191 -0
  60. package/tools/approve.js +197 -0
  61. package/tools/artifact-create.js +14 -3
  62. package/tools/artifacts-price.js +107 -0
  63. package/tools/available.js +120 -0
  64. package/tools/broadcast.js +325 -0
  65. package/tools/chat.js +202 -0
  66. package/tools/collaborative-drawing.js +1 -1
  67. package/tools/connection-status.js +178 -0
  68. package/tools/discover.js +350 -34
  69. package/tools/dm.js +80 -8
  70. package/tools/earnings.js +126 -0
  71. package/tools/feed.js +35 -4
  72. package/tools/follow.js +224 -0
  73. package/tools/friends.js +207 -0
  74. package/tools/gig-browse.js +206 -0
  75. package/tools/gig-complete.js +144 -0
  76. package/tools/health.js +87 -0
  77. package/tools/help.js +3 -3
  78. package/tools/idea.js +9 -2
  79. package/tools/inbox.js +289 -105
  80. package/tools/init.js +131 -34
  81. package/tools/invite.js +15 -4
  82. package/tools/leaderboard.js +117 -0
  83. package/tools/lib/git-apply.js +206 -0
  84. package/tools/lib/git-bundle.js +407 -0
  85. package/tools/migrate.js +3 -3
  86. package/tools/multiplayer-game.js +1 -1
  87. package/tools/onboarding.js +7 -7
  88. package/tools/open.js +143 -12
  89. package/tools/party-game.js +1 -1
  90. package/tools/plan.js +225 -0
  91. package/tools/proof-of-work.js +144 -0
  92. package/tools/reply.js +166 -0
  93. package/tools/report.js +1 -1
  94. package/tools/request.js +17 -3
  95. package/tools/schedule.js +367 -0
  96. package/tools/search-messages.js +123 -0
  97. package/tools/session.js +467 -0
  98. package/tools/session_price.js +128 -0
  99. package/tools/settings.js +90 -2
  100. package/tools/ship.js +30 -7
  101. package/tools/smart-check.js +201 -0
  102. package/tools/start.js +147 -12
  103. package/tools/status.js +53 -6
  104. package/tools/streak.js +147 -0
  105. package/tools/stuck.js +297 -0
  106. package/tools/subscribe.js +148 -0
  107. package/tools/subscriptions.js +134 -0
  108. package/tools/suggest-tags.js +6 -8
  109. package/tools/tag-suggestions.js +1 -1
  110. package/tools/tip.js +150 -77
  111. package/tools/token.js +4 -4
  112. package/tools/update.js +1 -1
  113. package/tools/wallet.js +221 -79
  114. package/tools/watch.js +157 -0
  115. package/tools/who.js +30 -1
  116. package/tools/withdraw.js +145 -0
  117. package/tools/work-summary.js +96 -0
  118. package/version.json +10 -8
  119. package/LICENSE +0 -21
  120. package/store/sqlite.js +0 -347
  121. /package/tools/{auto-suggest-connections.js → _deprecated/auto-suggest-connections.js} +0 -0
  122. /package/tools/{away.js → _deprecated/away.js} +0 -0
  123. /package/tools/{back.js → _deprecated/back.js} +0 -0
  124. /package/tools/{bootstrap-skills.js → _deprecated/bootstrap-skills.js} +0 -0
  125. /package/tools/{bridge-dashboard.js → _deprecated/bridge-dashboard.js} +0 -0
  126. /package/tools/{bridge-health.js → _deprecated/bridge-health.js} +0 -0
  127. /package/tools/{bridge-live.js → _deprecated/bridge-live.js} +0 -0
  128. /package/tools/{bridges.js → _deprecated/bridges.js} +0 -0
  129. /package/tools/{colorguess.js → _deprecated/colorguess.js} +0 -0
  130. /package/tools/{discover-insights.js → _deprecated/discover-insights.js} +0 -0
  131. /package/tools/{discover-momentum.js → _deprecated/discover-momentum.js} +0 -0
  132. /package/tools/{discovery-analytics.js → _deprecated/discovery-analytics.js} +0 -0
  133. /package/tools/{discovery-auto-suggest.js → _deprecated/discovery-auto-suggest.js} +0 -0
  134. /package/tools/{discovery-bootstrap.js → _deprecated/discovery-bootstrap.js} +0 -0
  135. /package/tools/{discovery-daily.js → _deprecated/discovery-daily.js} +0 -0
  136. /package/tools/{discovery-dashboard.js → _deprecated/discovery-dashboard.js} +0 -0
  137. /package/tools/{discovery-digest.js → _deprecated/discovery-digest.js} +0 -0
  138. /package/tools/{discovery-hub.js → _deprecated/discovery-hub.js} +0 -0
  139. /package/tools/{discovery-insights.js → _deprecated/discovery-insights.js} +0 -0
  140. /package/tools/{discovery-momentum.js → _deprecated/discovery-momentum.js} +0 -0
  141. /package/tools/{discovery-monitor.js → _deprecated/discovery-monitor.js} +0 -0
  142. /package/tools/{discovery-proactive.js → _deprecated/discovery-proactive.js} +0 -0
  143. /package/tools/{draw.js → _deprecated/draw.js} +0 -0
  144. /package/tools/{farcaster.js → _deprecated/farcaster.js} +0 -0
  145. /package/tools/{forget.js → _deprecated/forget.js} +0 -0
  146. /package/tools/{games-catalog.js → _deprecated/games-catalog.js} +0 -0
  147. /package/tools/{games.js → _deprecated/games.js} +0 -0
  148. /package/tools/{guessnumber.js → _deprecated/guessnumber.js} +0 -0
  149. /package/tools/{hangman.js → _deprecated/hangman.js} +0 -0
  150. /package/tools/{multiplayer-tictactoe.js → _deprecated/multiplayer-tictactoe.js} +0 -0
  151. /package/tools/{mute.js → _deprecated/mute.js} +0 -0
  152. /package/tools/{recall.js → _deprecated/recall.js} +0 -0
  153. /package/tools/{remember.js → _deprecated/remember.js} +0 -0
  154. /package/tools/{riddle.js → _deprecated/riddle.js} +0 -0
  155. /package/tools/{run-bootstrap.js → _deprecated/run-bootstrap.js} +0 -0
  156. /package/tools/{skills-analytics.js → _deprecated/skills-analytics.js} +0 -0
  157. /package/tools/{skills-bootstrap.js → _deprecated/skills-bootstrap.js} +0 -0
  158. /package/tools/{skills-dashboard.js → _deprecated/skills-dashboard.js} +0 -0
  159. /package/tools/{skills-exchange.js → _deprecated/skills-exchange.js} +0 -0
  160. /package/tools/{skills.js → _deprecated/skills.js} +0 -0
  161. /package/tools/{smart-intro.js → _deprecated/smart-intro.js} +0 -0
  162. /package/tools/{storybuilder.js → _deprecated/storybuilder.js} +0 -0
  163. /package/tools/{telegram-bot.js → _deprecated/telegram-bot.js} +0 -0
  164. /package/tools/{telegram-setup.js → _deprecated/telegram-setup.js} +0 -0
  165. /package/tools/{tictactoe.js → _deprecated/tictactoe.js} +0 -0
  166. /package/tools/{twentyquestions.js → _deprecated/twentyquestions.js} +0 -0
  167. /package/tools/{wordassociation.js → _deprecated/wordassociation.js} +0 -0
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Game Router - Quick launcher for any workshop game
3
+ * Routes game commands to the appropriate game implementation
4
+ * Makes all games easily accessible with simple commands
5
+ */
6
+
7
+ // Import all game systems
8
+ const arcade = require('./arcade');
9
+ const drawing = require('./drawing');
10
+ const pixelart = require('./pixelart');
11
+ const gamestatus = require('./gamestatus');
12
+ const hangman = require('./hangman');
13
+ const wordchain = require('./wordchain');
14
+ const twentyquestions = require('./twentyquestions');
15
+ const wordassociation = require('./wordassociation');
16
+
17
+ // Game routing table - maps game IDs to their implementations
18
+ const GAME_ROUTES = {
19
+ // Discovery & navigation
20
+ 'arcade': {
21
+ type: 'navigation',
22
+ module: arcade,
23
+ createState: arcade.createInitialArcadeState,
24
+ display: arcade.formatArcadeDisplay,
25
+ handleCommand: arcade.handleArcadeCommand,
26
+ description: 'Browse all available games'
27
+ },
28
+
29
+ 'gamestatus': {
30
+ type: 'status',
31
+ module: gamestatus,
32
+ createState: gamestatus.createInitialGameStatusState,
33
+ display: gamestatus.formatGameStatusDisplay,
34
+ handleCommand: gamestatus.handleGameStatusCommand,
35
+ description: 'See game overview and get recommendations'
36
+ },
37
+
38
+ // Creative & collaborative games
39
+ 'drawing': {
40
+ type: 'collaborative',
41
+ module: drawing,
42
+ createState: drawing.createInitialDrawingState,
43
+ display: drawing.formatDrawingDisplay,
44
+ handleCommand: null, // Uses direct methods
45
+ description: 'Collaborative drawing canvas'
46
+ },
47
+
48
+ 'pixelart': {
49
+ type: 'collaborative',
50
+ module: pixelart,
51
+ createState: pixelart.createInitialPixelArtState,
52
+ display: pixelart.formatPixelArtDisplay,
53
+ handleCommand: null,
54
+ description: 'Collaborative pixel art creation'
55
+ },
56
+
57
+ // Single-player games
58
+ 'hangman': {
59
+ type: 'singleplayer',
60
+ module: hangman,
61
+ createState: hangman.createInitialHangmanState,
62
+ display: hangman.formatHangmanDisplay,
63
+ handleCommand: null,
64
+ description: 'Classic word guessing game'
65
+ },
66
+
67
+ 'twentyquestions': {
68
+ type: 'interactive',
69
+ module: twentyquestions,
70
+ createState: twentyquestions.createInitialTwentyQuestionsState,
71
+ display: twentyquestions.formatTwentyQuestionsDisplay,
72
+ handleCommand: null,
73
+ description: 'Guess what I\'m thinking!'
74
+ },
75
+
76
+ // Multiplayer word games
77
+ 'wordchain': {
78
+ type: 'multiplayer',
79
+ module: wordchain,
80
+ createState: wordchain.createInitialWordChainState,
81
+ display: wordchain.formatWordChainDisplay,
82
+ handleCommand: null,
83
+ description: 'Build chains of connected words'
84
+ },
85
+
86
+ 'wordassociation': {
87
+ type: 'multiplayer',
88
+ module: wordassociation,
89
+ createState: wordassociation.createInitialWordAssociationState,
90
+ display: wordassociation.formatWordAssociationDisplay,
91
+ handleCommand: null,
92
+ description: 'Quick-fire word connections'
93
+ }
94
+ };
95
+
96
+ // Get list of all routable games
97
+ function getAvailableGames() {
98
+ return Object.keys(GAME_ROUTES);
99
+ }
100
+
101
+ // Check if a game is available
102
+ function gameAvailable(gameId) {
103
+ return !!GAME_ROUTES[gameId];
104
+ }
105
+
106
+ // Get game info
107
+ function getGameRoute(gameId) {
108
+ return GAME_ROUTES[gameId];
109
+ }
110
+
111
+ // Create initial state for any game
112
+ function createGameState(gameId) {
113
+ const route = GAME_ROUTES[gameId];
114
+ if (!route) {
115
+ return { error: `Game '${gameId}' not found!` };
116
+ }
117
+
118
+ try {
119
+ const state = route.createState();
120
+ return {
121
+ success: true,
122
+ gameState: state,
123
+ gameType: route.type,
124
+ gameId: gameId
125
+ };
126
+ } catch (error) {
127
+ return { error: `Failed to create ${gameId}: ${error.message}` };
128
+ }
129
+ }
130
+
131
+ // Display game state
132
+ function displayGame(gameId, gameState) {
133
+ const route = GAME_ROUTES[gameId];
134
+ if (!route) {
135
+ return `Error: Game '${gameId}' not found!`;
136
+ }
137
+
138
+ try {
139
+ return route.display(gameState);
140
+ } catch (error) {
141
+ return `Error displaying ${gameId}: ${error.message}`;
142
+ }
143
+ }
144
+
145
+ // Handle game command
146
+ function handleGameCommand(gameId, gameState, command) {
147
+ const route = GAME_ROUTES[gameId];
148
+ if (!route) {
149
+ return { error: `Game '${gameId}' not found!` };
150
+ }
151
+
152
+ if (!route.handleCommand) {
153
+ return { error: `Game '${gameId}' doesn't support text commands. Use specific game actions.` };
154
+ }
155
+
156
+ try {
157
+ return route.handleCommand(gameState, command);
158
+ } catch (error) {
159
+ return { error: `Command failed: ${error.message}` };
160
+ }
161
+ }
162
+
163
+ // Get game suggestions based on preferences
164
+ function getGameSuggestions(playerCount = 'any', difficulty = 'any', category = 'any') {
165
+ const allGames = arcade.GAMES;
166
+ let suggestions = Object.entries(allGames);
167
+
168
+ // Filter by player count
169
+ if (playerCount !== 'any') {
170
+ suggestions = suggestions.filter(([id, game]) => {
171
+ if (playerCount === 'solo') return game.players === 'Solo';
172
+ if (playerCount === 'multiplayer') return game.players !== 'Solo';
173
+ return true;
174
+ });
175
+ }
176
+
177
+ // Filter by difficulty
178
+ if (difficulty !== 'any') {
179
+ suggestions = suggestions.filter(([id, game]) =>
180
+ game.difficulty.toLowerCase() === difficulty.toLowerCase()
181
+ );
182
+ }
183
+
184
+ // Filter by category
185
+ if (category !== 'any') {
186
+ suggestions = suggestions.filter(([id, game]) => game.category === category);
187
+ }
188
+
189
+ return suggestions.map(([id, game]) => ({
190
+ id,
191
+ name: game.name,
192
+ description: game.description,
193
+ players: game.players,
194
+ difficulty: game.difficulty,
195
+ category: game.category,
196
+ icon: game.icon,
197
+ available: gameAvailable(id)
198
+ }));
199
+ }
200
+
201
+ // Get quick start instructions for a game
202
+ function getQuickStart(gameId) {
203
+ const instructions = {
204
+ 'arcade': 'Browse all games! Try typing category names like `classic` or game names like `chess`.',
205
+ 'gamestatus': 'See game overview! Try `easy`, `solo`, `multiplayer` to filter games.',
206
+ 'drawing': 'Join collaborative drawing! Use coordinates and character names to draw.',
207
+ 'pixelart': 'Create pixel art! Place colored pixels to make collaborative art.',
208
+ 'hangman': 'Guess letters to reveal the hidden word! Try common letters first.',
209
+ 'twentyquestions': 'Ask yes/no questions to guess what I\'m thinking! You have 20 tries.',
210
+ 'wordchain': 'Build word chains! Each word must connect to the previous word.',
211
+ 'wordassociation': 'Say the first word that comes to mind! Build associations.'
212
+ };
213
+
214
+ return instructions[gameId] || 'Game instructions not available. Check the game description for details.';
215
+ }
216
+
217
+ // Format router help/overview
218
+ function formatRouterHelp() {
219
+ let help = '🎮 **GAME ROUTER - Quick Access to All Games**\n\n';
220
+
221
+ // Group by type
222
+ const byType = {};
223
+ Object.entries(GAME_ROUTES).forEach(([id, route]) => {
224
+ if (!byType[route.type]) byType[route.type] = [];
225
+ byType[route.type].push({ id, ...route });
226
+ });
227
+
228
+ Object.entries(byType).forEach(([type, games]) => {
229
+ const typeLabels = {
230
+ navigation: '🧭 Navigation & Discovery',
231
+ status: '📊 Game Information',
232
+ collaborative: '🎨 Collaborative Games',
233
+ singleplayer: '🎯 Solo Games',
234
+ multiplayer: '👥 Multiplayer Games',
235
+ interactive: '🤖 Interactive Games'
236
+ };
237
+
238
+ help += `**${typeLabels[type] || type.toUpperCase()}**\n`;
239
+ games.forEach(game => {
240
+ help += `• \`${game.id}\` - ${game.description}\n`;
241
+ });
242
+ help += '\n';
243
+ });
244
+
245
+ help += '**Quick Commands:**\n';
246
+ help += '• Type any game ID to launch it\n';
247
+ help += '• `available` - List all games\n';
248
+ help += '• `suggest solo/multiplayer easy/medium` - Get recommendations\n';
249
+ help += '• `arcade` - Browse full game collection\n';
250
+ help += '• `gamestatus` - See what\'s available\n\n';
251
+
252
+ help += '**Integration:**\n';
253
+ help += 'Use `vibe game @user` for tic-tac-toe/chess\n';
254
+ help += 'Use individual game names for other games\n';
255
+
256
+ return help;
257
+ }
258
+
259
+ // Handle general router commands
260
+ function handleRouterCommand(command) {
261
+ const cmd = command.toLowerCase().trim();
262
+
263
+ if (cmd === 'available' || cmd === 'list') {
264
+ const games = getAvailableGames();
265
+ return {
266
+ success: true,
267
+ display: `**Available Games (${games.length}):**\n${games.join(', ')}\n\nType any game name to launch it!`
268
+ };
269
+ }
270
+
271
+ if (cmd.startsWith('suggest')) {
272
+ // Parse suggestion parameters
273
+ const parts = cmd.split(' ').slice(1); // Remove 'suggest'
274
+ let playerCount = 'any';
275
+ let difficulty = 'any';
276
+
277
+ parts.forEach(part => {
278
+ if (['solo', 'multiplayer'].includes(part)) playerCount = part;
279
+ if (['easy', 'medium', 'hard'].includes(part)) difficulty = part;
280
+ });
281
+
282
+ const suggestions = getGameSuggestions(playerCount, difficulty);
283
+
284
+ let response = `🎯 **Game Suggestions** (${suggestions.length} games)\n`;
285
+ if (playerCount !== 'any') response += `*${playerCount} games*\n`;
286
+ if (difficulty !== 'any') response += `*${difficulty} difficulty*\n`;
287
+ response += '\n';
288
+
289
+ suggestions.slice(0, 8).forEach(game => {
290
+ const status = game.available ? '✅' : '🚧';
291
+ response += `${status} ${game.icon} **${game.name}** (${game.players})\n`;
292
+ response += ` *${game.description}*\n\n`;
293
+ });
294
+
295
+ return { success: true, display: response };
296
+ }
297
+
298
+ if (cmd === 'help' || cmd === '?') {
299
+ return { success: true, display: formatRouterHelp() };
300
+ }
301
+
302
+ // Check if it's a game launch command
303
+ if (gameAvailable(cmd)) {
304
+ const result = createGameState(cmd);
305
+ if (result.error) {
306
+ return { error: result.error };
307
+ }
308
+
309
+ const display = displayGame(cmd, result.gameState);
310
+ const instructions = getQuickStart(cmd);
311
+
312
+ return {
313
+ success: true,
314
+ display: display + '\n\n💡 **Quick Start:** ' + instructions,
315
+ gameState: result.gameState,
316
+ gameId: cmd,
317
+ gameType: result.gameType
318
+ };
319
+ }
320
+
321
+ return { error: `Unknown command '${cmd}'. Type 'help' for available commands or 'available' for game list.` };
322
+ }
323
+
324
+ module.exports = {
325
+ GAME_ROUTES,
326
+ getAvailableGames,
327
+ gameAvailable,
328
+ getGameRoute,
329
+ createGameState,
330
+ displayGame,
331
+ handleGameCommand,
332
+ getGameSuggestions,
333
+ getQuickStart,
334
+ formatRouterHelp,
335
+ handleRouterCommand
336
+ };
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Game Status Checker - See what games are available and what's happening
3
+ * Helps users discover games and find active sessions to join
4
+ */
5
+
6
+ // Import arcade data for game information
7
+ const { GAMES, CATEGORIES } = require('./arcade');
8
+
9
+ // Create initial game status state
10
+ function createInitialGameStatusState() {
11
+ return {
12
+ view: 'overview', // 'overview', 'category', 'active'
13
+ selectedCategory: null,
14
+ lastChecked: new Date().toISOString(),
15
+ refreshCount: 0
16
+ };
17
+ }
18
+
19
+ // Get overview of all available games
20
+ function getGameOverview() {
21
+ const totalGames = Object.keys(GAMES).length;
22
+ const categoryCounts = {};
23
+
24
+ // Count games by category
25
+ Object.values(GAMES).forEach(game => {
26
+ categoryCounts[game.category] = (categoryCounts[game.category] || 0) + 1;
27
+ });
28
+
29
+ // Count by player type
30
+ const playerTypes = {
31
+ solo: 0,
32
+ multiplayer: 0,
33
+ versus: 0
34
+ };
35
+
36
+ Object.values(GAMES).forEach(game => {
37
+ if (game.players === 'Solo') {
38
+ playerTypes.solo++;
39
+ } else if (game.players.includes('v1') || game.players === '1v1') {
40
+ playerTypes.versus++;
41
+ } else {
42
+ playerTypes.multiplayer++;
43
+ }
44
+ });
45
+
46
+ return {
47
+ totalGames,
48
+ categoryCounts,
49
+ playerTypes
50
+ };
51
+ }
52
+
53
+ // Get featured games (popular/recommended)
54
+ function getFeaturedGames() {
55
+ // Hand-picked selection of great games to try
56
+ const featured = [
57
+ 'tictactoe', // Classic and simple
58
+ 'chess', // Strategic depth
59
+ 'drawing', // Creative collaboration
60
+ 'pixelart', // Artistic fun
61
+ 'hangman', // Word game classic
62
+ 'wordchain', // Interactive word game
63
+ 'snake', // Action-packed
64
+ 'werewolf', // Social deduction
65
+ 'twentyquestions' // Interactive guessing
66
+ ];
67
+
68
+ return featured
69
+ .filter(id => GAMES[id]) // Make sure game exists
70
+ .map(id => ({ id, ...GAMES[id] }));
71
+ }
72
+
73
+ // Get games by difficulty level
74
+ function getGamesByDifficulty(difficulty) {
75
+ return Object.entries(GAMES)
76
+ .filter(([id, game]) => game.difficulty.toLowerCase() === difficulty.toLowerCase())
77
+ .map(([id, game]) => ({ id, ...game }));
78
+ }
79
+
80
+ // Get games suitable for quick play (easy/medium difficulty)
81
+ function getQuickPlayGames() {
82
+ return Object.entries(GAMES)
83
+ .filter(([id, game]) => ['Easy', 'Medium'].includes(game.difficulty))
84
+ .map(([id, game]) => ({ id, ...game }));
85
+ }
86
+
87
+ // Get games by player count preference
88
+ function getGamesByPlayerType(playerType) {
89
+ const filters = {
90
+ solo: game => game.players === 'Solo',
91
+ competitive: game => game.players.includes('v1') || game.players === '1v1',
92
+ multiplayer: game => !game.players.includes('Solo') && !game.players.includes('v1'),
93
+ any: () => true
94
+ };
95
+
96
+ const filter = filters[playerType] || filters.any;
97
+
98
+ return Object.entries(GAMES)
99
+ .filter(([id, game]) => filter(game))
100
+ .map(([id, game]) => ({ id, ...game }));
101
+ }
102
+
103
+ // Format game status display
104
+ function formatGameStatusDisplay(gameState) {
105
+ const { view, selectedCategory, refreshCount } = gameState;
106
+ const overview = getGameOverview();
107
+
108
+ let display = '';
109
+
110
+ if (view === 'overview') {
111
+ // Main game status overview
112
+ display += '🎮 **GAME STATUS & DISCOVERY**\n\n';
113
+ display += `**📊 Overview** • Refresh #${refreshCount + 1}\n`;
114
+ display += `**${overview.totalGames} games available** in the Workshop Arcade\n\n`;
115
+
116
+ // Category breakdown
117
+ display += '**📂 Games by Category:**\n';
118
+ Object.entries(overview.categoryCounts).forEach(([category, count]) => {
119
+ const categoryInfo = CATEGORIES[category];
120
+ if (categoryInfo) {
121
+ display += `${categoryInfo.icon} ${categoryInfo.name}: **${count} games**\n`;
122
+ }
123
+ });
124
+ display += '\n';
125
+
126
+ // Player type breakdown
127
+ display += '**👥 Games by Player Type:**\n';
128
+ display += `🎯 Solo games: **${overview.playerTypes.solo}**\n`;
129
+ display += `⚔️ 1v1 competitive: **${overview.playerTypes.versus}**\n`;
130
+ display += `👥 Multiplayer: **${overview.playerTypes.multiplayer}**\n\n`;
131
+
132
+ // Featured games
133
+ const featured = getFeaturedGames();
134
+ display += '**⭐ Featured Games (Great to Try):**\n';
135
+ featured.slice(0, 6).forEach(game => {
136
+ display += `${game.icon} **${game.name}** (${game.players}) - ${game.description}\n`;
137
+ });
138
+ display += '\n';
139
+
140
+ // Quick recommendations
141
+ display += '**🚀 Quick Recommendations:**\n';
142
+ display += '• **New to games?** Try Tic-Tac-Toe or Number Guessing\n';
143
+ display += '• **Want creativity?** Check out Collaborative Drawing or Pixel Art\n';
144
+ display += '• **Like words?** Try Hangman, Word Chain, or Twenty Questions\n';
145
+ display += '• **Social fun?** Werewolf or Two Truths & A Lie are great with friends\n\n';
146
+
147
+ display += '**💡 Commands:**\n';
148
+ display += '• Type `arcade` or `games` to launch the full Workshop Arcade\n';
149
+ display += '• Type `easy`, `medium`, or `hard` to filter by difficulty\n';
150
+ display += '• Type `solo`, `competitive`, or `multiplayer` to filter by type\n';
151
+ display += '• Type `refresh` to update this status\n';
152
+
153
+ } else if (view === 'category') {
154
+ // Category-specific view (if implemented)
155
+ const categoryInfo = CATEGORIES[selectedCategory];
156
+ display += `${categoryInfo.icon} **${categoryInfo.name.toUpperCase()}**\n\n`;
157
+ display += `*${categoryInfo.description}*\n\n`;
158
+
159
+ const categoryGames = Object.entries(GAMES)
160
+ .filter(([id, game]) => game.category === selectedCategory)
161
+ .map(([id, game]) => ({ id, ...game }));
162
+
163
+ categoryGames.forEach(game => {
164
+ display += `${game.icon} **${game.name}** (${game.players})\n`;
165
+ display += ` *${game.description}*\n\n`;
166
+ });
167
+ }
168
+
169
+ return display;
170
+ }
171
+
172
+ // Handle game status commands
173
+ function handleGameStatusCommand(gameState, command) {
174
+ const cmd = command.toLowerCase().trim();
175
+
176
+ // Refresh command
177
+ if (cmd === 'refresh' || cmd === 'update') {
178
+ return {
179
+ success: true,
180
+ gameState: {
181
+ ...gameState,
182
+ lastChecked: new Date().toISOString(),
183
+ refreshCount: gameState.refreshCount + 1
184
+ }
185
+ };
186
+ }
187
+
188
+ // Difficulty filters
189
+ if (['easy', 'medium', 'hard'].includes(cmd)) {
190
+ const games = getGamesByDifficulty(cmd);
191
+ let response = `🎯 **${cmd.toUpperCase()} DIFFICULTY GAMES**\n\n`;
192
+
193
+ games.forEach(game => {
194
+ response += `${game.icon} **${game.name}** (${game.players})\n`;
195
+ response += ` *${game.description}*\n\n`;
196
+ });
197
+
198
+ response += `*Found ${games.length} games with ${cmd} difficulty*`;
199
+
200
+ return { success: true, customDisplay: response };
201
+ }
202
+
203
+ // Player type filters
204
+ if (['solo', 'competitive', 'multiplayer'].includes(cmd)) {
205
+ const games = getGamesByPlayerType(cmd);
206
+ let response = `👥 **${cmd.toUpperCase()} GAMES**\n\n`;
207
+
208
+ games.forEach(game => {
209
+ response += `${game.icon} **${game.name}** (${game.players})\n`;
210
+ response += ` *${game.description}*\n\n`;
211
+ });
212
+
213
+ response += `*Found ${games.length} ${cmd} games*`;
214
+
215
+ return { success: true, customDisplay: response };
216
+ }
217
+
218
+ // Quick play filter
219
+ if (cmd === 'quick' || cmd === 'quickplay') {
220
+ const games = getQuickPlayGames();
221
+ let response = `⚡ **QUICK PLAY GAMES**\n\n`;
222
+ response += `*Easy to learn, fun to play!*\n\n`;
223
+
224
+ games.slice(0, 8).forEach(game => {
225
+ response += `${game.icon} **${game.name}** (${game.players})\n`;
226
+ response += ` *${game.description}*\n\n`;
227
+ });
228
+
229
+ return { success: true, customDisplay: response };
230
+ }
231
+
232
+ // Category navigation
233
+ if (CATEGORIES[cmd]) {
234
+ return {
235
+ success: true,
236
+ gameState: {
237
+ ...gameState,
238
+ view: 'category',
239
+ selectedCategory: cmd
240
+ }
241
+ };
242
+ }
243
+
244
+ // Back to overview
245
+ if (cmd === 'back' || cmd === 'overview' || cmd === 'main') {
246
+ return {
247
+ success: true,
248
+ gameState: {
249
+ ...gameState,
250
+ view: 'overview',
251
+ selectedCategory: null
252
+ }
253
+ };
254
+ }
255
+
256
+ // Launch arcade
257
+ if (cmd === 'arcade' || cmd === 'games' || cmd === 'launcher') {
258
+ return {
259
+ success: true,
260
+ customDisplay: '🎮 **Workshop Arcade** - Use the `arcade` game to launch the full game browser!\n\nType `vibe arcade` or start any specific game by name.'
261
+ };
262
+ }
263
+
264
+ // Help
265
+ if (cmd === 'help' || cmd === '?') {
266
+ let help = '🎮 **Game Status Commands**\n\n';
267
+ help += '**Filters:**\n';
268
+ help += '• `easy`, `medium`, `hard` - Games by difficulty\n';
269
+ help += '• `solo`, `competitive`, `multiplayer` - Games by player type\n';
270
+ help += '• `quick` - Easy to learn games\n\n';
271
+ help += '**Categories:**\n';
272
+ Object.entries(CATEGORIES).forEach(([id, cat]) => {
273
+ help += `• \`${id}\` - ${cat.name}\n`;
274
+ });
275
+ help += '\n**Actions:**\n';
276
+ help += '• `refresh` - Update game status\n';
277
+ help += '• `arcade` - Launch full game browser\n';
278
+ help += '• `back` - Return to overview\n';
279
+
280
+ return { success: true, customDisplay: help };
281
+ }
282
+
283
+ // Unknown command
284
+ return {
285
+ error: `Unknown command '${cmd}'. Try 'help' for available commands, or 'arcade' to browse all games.`
286
+ };
287
+ }
288
+
289
+ // Get a random game recommendation with reason
290
+ function getRandomGameRecommendation() {
291
+ const allGames = Object.entries(GAMES);
292
+ const randomGame = allGames[Math.floor(Math.random() * allGames.length)];
293
+ const [id, game] = randomGame;
294
+
295
+ const reasons = [
296
+ 'Great for beginners!',
297
+ 'Quick to learn, hard to master',
298
+ 'Perfect for a coffee break',
299
+ 'Lots of replayability',
300
+ 'Fan favorite in the workshop',
301
+ 'Creative and fun',
302
+ 'Good brain exercise',
303
+ 'Social and interactive'
304
+ ];
305
+
306
+ const reason = reasons[Math.floor(Math.random() * reasons.length)];
307
+
308
+ return {
309
+ id,
310
+ game,
311
+ reason
312
+ };
313
+ }
314
+
315
+ // Check if a specific game exists
316
+ function gameExists(gameId) {
317
+ return !!GAMES[gameId];
318
+ }
319
+
320
+ // Get game info by ID
321
+ function getGameInfo(gameId) {
322
+ return GAMES[gameId] ? { id: gameId, ...GAMES[gameId] } : null;
323
+ }
324
+
325
+ module.exports = {
326
+ createInitialGameStatusState,
327
+ getGameOverview,
328
+ getFeaturedGames,
329
+ getGamesByDifficulty,
330
+ getGamesByPlayerType,
331
+ getQuickPlayGames,
332
+ formatGameStatusDisplay,
333
+ handleGameStatusCommand,
334
+ getRandomGameRecommendation,
335
+ gameExists,
336
+ getGameInfo
337
+ };