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,336 +0,0 @@
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
- };
@@ -1,337 +0,0 @@
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
- };