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.
- package/LICENSE +21 -0
- package/README.md +280 -47
- package/auto-update.js +10 -15
- package/config.js +36 -31
- package/crypto.js +1 -6
- package/debug.js +12 -0
- package/discord.js +19 -19
- package/eslint.config.js +54 -0
- package/index.js +217 -207
- package/intelligence/index.js +2 -9
- package/intelligence/infer.js +10 -16
- package/intelligence/patterns.js +23 -18
- package/intelligence/proactive.js +16 -15
- package/intelligence/serendipity.js +57 -20
- package/memory.js +13 -8
- package/migrate-v2.js +72 -0
- package/notification-emitter.js +2 -2
- package/notify.js +39 -14
- package/package.json +28 -29
- package/post-install.js +141 -0
- package/presence.js +2 -2
- package/prompts.js +5 -9
- package/protocol/index.js +123 -87
- package/protocol/telegram-commands.js +36 -37
- package/store/api.js +358 -529
- package/store/local.js +9 -10
- package/store/profiles.js +48 -192
- package/store/reservations.js +2 -9
- package/store/skills.js +69 -71
- package/store/sqlite.js +355 -0
- package/test-skills-bootstrap.js +20 -0
- package/test-v2-integration.js +385 -0
- package/tools/_actions.js +48 -387
- package/tools/_connection-queue.js +45 -56
- package/tools/_discovery-enhanced.js +52 -57
- package/tools/_discovery.js +87 -185
- package/tools/{l2-status.js → _experimental/l2-status.js} +68 -70
- package/tools/{shipback.js → _experimental/shipback.js} +4 -3
- package/tools/_proactive-discovery.js +60 -73
- package/tools/_shared/index.js +41 -64
- package/tools/admin-inbox.js +10 -15
- package/tools/agents.js +1 -1
- package/tools/artifact-create.js +13 -23
- package/tools/artifact-view.js +4 -4
- package/tools/{_deprecated/back.js → back.js} +1 -1
- package/tools/bye.js +3 -5
- package/tools/consent.js +2 -2
- package/tools/context.js +9 -10
- package/tools/crossword.js +3 -2
- package/tools/discover.js +94 -356
- package/tools/dm.js +27 -86
- package/tools/doctor.js +12 -41
- package/tools/drawing.js +34 -20
- package/tools/echo.js +11 -11
- package/tools/feed.js +30 -58
- package/tools/follow.js +64 -187
- package/tools/{_deprecated/forget.js → forget.js} +4 -7
- package/tools/game.js +144 -48
- package/tools/handoff.js +6 -8
- package/tools/help.js +3 -3
- package/tools/idea.js +15 -27
- package/tools/inbox.js +121 -293
- package/tools/init.js +54 -151
- package/tools/invite.js +8 -21
- package/tools/migrate.js +27 -24
- package/tools/multiplayer-game.js +50 -40
- package/tools/{_deprecated/mute.js → mute.js} +4 -3
- package/tools/notifications.js +58 -48
- package/tools/observe.js +12 -15
- package/tools/onboarding.js +8 -11
- package/tools/open.js +13 -144
- package/tools/party-game.js +23 -12
- package/tools/patterns.js +2 -1
- package/tools/ping.js +5 -7
- package/tools/react.js +28 -30
- package/tools/{_deprecated/recall.js → recall.js} +5 -10
- package/tools/release.js +4 -2
- package/tools/{_deprecated/remember.js → remember.js} +4 -6
- package/tools/report.js +2 -2
- package/tools/request.js +6 -26
- package/tools/reserve.js +1 -1
- package/tools/session-fork.js +97 -0
- package/tools/session-save.js +109 -0
- package/tools/settings.js +30 -99
- package/tools/ship.js +74 -56
- package/tools/{_deprecated/skills-exchange.js → skills-exchange.js} +38 -39
- package/tools/social-inbox.js +22 -28
- package/tools/social-post.js +24 -27
- package/tools/solo-game.js +54 -46
- package/tools/start.js +14 -148
- package/tools/status.js +21 -68
- package/tools/submit.js +4 -2
- package/tools/suggest-tags.js +36 -33
- package/tools/summarize.js +19 -16
- package/tools/tag-suggestions.js +72 -73
- package/tools/test.js +1 -1
- package/tools/{_deprecated/tictactoe.js → tictactoe.js} +26 -26
- package/tools/token.js +4 -4
- package/tools/update.js +1 -2
- package/tools/watch.js +132 -112
- package/tools/who.js +20 -40
- package/tools/{_deprecated/wordassociation.js → wordassociation.js} +23 -20
- package/tools/workshop-buddy.js +52 -53
- package/tools/x-mentions.js +0 -1
- package/tools/x-reply.js +0 -1
- package/twitter.js +14 -20
- package/version.json +8 -10
- package/webhook-runner.js +132 -0
- package/auth-store.js +0 -148
- package/bridges/bridge-monitor.js +0 -388
- package/bridges/discord-bot.js +0 -431
- package/bridges/farcaster.js +0 -299
- package/bridges/telegram.js +0 -261
- package/bridges/webhook-health.js +0 -420
- package/bridges/webhook-server.js +0 -437
- package/bridges/whatsapp.js +0 -441
- package/bridges/x-webhook.js +0 -423
- package/games/arcade.js +0 -406
- package/games/chess.js +0 -451
- package/games/colorguess.js +0 -343
- package/games/crossword-words.js +0 -171
- package/games/crossword.js +0 -461
- package/games/drawing.js +0 -347
- package/games/gameroulette.js +0 -300
- package/games/gamerouter.js +0 -336
- package/games/gamestatus.js +0 -337
- package/games/guessnumber.js +0 -209
- package/games/hangman.js +0 -279
- package/games/memory.js +0 -338
- package/games/multiplayer-tictactoe.js +0 -389
- package/games/pixelart.js +0 -399
- package/games/quickduel.js +0 -354
- package/games/riddle.js +0 -371
- package/games/rockpaperscissors.js +0 -291
- package/games/snake.js +0 -406
- package/games/storybuilder.js +0 -343
- package/games/tictactoe.js +0 -345
- package/games/twentyquestions.js +0 -286
- package/games/twotruths.js +0 -207
- package/games/werewolf.js +0 -508
- package/games/wordassociation.js +0 -247
- package/games/wordchain.js +0 -135
- package/intelligence/interests.js +0 -369
- package/setup.js +0 -480
- package/smart-inbox.js +0 -276
- package/tools/_deprecated/auto-suggest-connections.js +0 -304
- package/tools/_deprecated/bootstrap-skills.js +0 -231
- package/tools/_deprecated/bridge-dashboard.js +0 -342
- package/tools/_deprecated/bridge-health.js +0 -400
- package/tools/_deprecated/bridge-live.js +0 -384
- package/tools/_deprecated/bridges.js +0 -383
- package/tools/_deprecated/colorguess.js +0 -281
- package/tools/_deprecated/discover-insights.js +0 -379
- package/tools/_deprecated/discover-momentum.js +0 -256
- package/tools/_deprecated/discovery-analytics.js +0 -345
- package/tools/_deprecated/discovery-auto-suggest.js +0 -275
- package/tools/_deprecated/discovery-bootstrap.js +0 -267
- package/tools/_deprecated/discovery-daily.js +0 -375
- package/tools/_deprecated/discovery-dashboard.js +0 -385
- package/tools/_deprecated/discovery-digest.js +0 -314
- package/tools/_deprecated/discovery-hub.js +0 -357
- package/tools/_deprecated/discovery-insights.js +0 -384
- package/tools/_deprecated/discovery-momentum.js +0 -281
- package/tools/_deprecated/discovery-monitor.js +0 -319
- package/tools/_deprecated/discovery-proactive.js +0 -300
- package/tools/_deprecated/draw.js +0 -317
- package/tools/_deprecated/farcaster.js +0 -307
- package/tools/_deprecated/games-catalog.js +0 -376
- package/tools/_deprecated/games.js +0 -313
- package/tools/_deprecated/guessnumber.js +0 -194
- package/tools/_deprecated/hangman.js +0 -129
- package/tools/_deprecated/multiplayer-tictactoe.js +0 -303
- package/tools/_deprecated/riddle.js +0 -240
- package/tools/_deprecated/run-bootstrap.js +0 -69
- package/tools/_deprecated/skills-analytics.js +0 -349
- package/tools/_deprecated/skills-bootstrap.js +0 -301
- package/tools/_deprecated/skills-dashboard.js +0 -268
- package/tools/_deprecated/skills.js +0 -380
- package/tools/_deprecated/smart-intro.js +0 -353
- package/tools/_deprecated/storybuilder.js +0 -331
- package/tools/_deprecated/telegram-bot.js +0 -183
- package/tools/_deprecated/telegram-setup.js +0 -214
- package/tools/_deprecated/twentyquestions.js +0 -143
- package/tools/_shared.js +0 -234
- package/tools/_work-context.js +0 -338
- package/tools/_work-context.manual-test.js +0 -199
- package/tools/_work-context.test.js +0 -260
- package/tools/activity.js +0 -220
- package/tools/agent-treasury.js +0 -288
- package/tools/analytics.js +0 -191
- package/tools/approve.js +0 -197
- package/tools/arcade.js +0 -173
- package/tools/artifacts-price.js +0 -107
- package/tools/ask-expert.js +0 -160
- package/tools/available.js +0 -120
- package/tools/become-expert.js +0 -150
- package/tools/broadcast.js +0 -325
- package/tools/chat.js +0 -202
- package/tools/collaborative-drawing.js +0 -286
- package/tools/connection-status.js +0 -178
- package/tools/earnings.js +0 -126
- package/tools/friends.js +0 -207
- package/tools/genesis.js +0 -233
- package/tools/gig-browse.js +0 -206
- package/tools/gig-complete.js +0 -144
- package/tools/health.js +0 -87
- package/tools/leaderboard.js +0 -117
- package/tools/lib/git-apply.js +0 -206
- package/tools/lib/git-bundle.js +0 -407
- package/tools/mint.js +0 -377
- package/tools/plan.js +0 -225
- package/tools/profile.js +0 -219
- package/tools/proof-of-work.js +0 -144
- package/tools/pulse.js +0 -218
- package/tools/reply.js +0 -166
- package/tools/reputation.js +0 -175
- package/tools/schedule.js +0 -367
- package/tools/search-messages.js +0 -123
- package/tools/session.js +0 -467
- package/tools/session_price.js +0 -128
- package/tools/smart-check.js +0 -201
- package/tools/social-processor.js +0 -445
- package/tools/streak.js +0 -147
- package/tools/stuck.js +0 -297
- package/tools/subscribe.js +0 -148
- package/tools/subscriptions.js +0 -134
- package/tools/tip.js +0 -193
- package/tools/wallet.js +0 -269
- package/tools/webhook-test.js +0 -388
- package/tools/withdraw.js +0 -145
- package/tools/work-summary.js +0 -96
- package/tools/workshop.js +0 -327
- /package/tools/{l2-bridge.js → _experimental/l2-bridge.js} +0 -0
- /package/tools/{l2.js → _experimental/l2.js} +0 -0
- /package/tools/{_deprecated/away.js → away.js} +0 -0
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe bridges — Manage external platform bridges
|
|
3
|
-
*
|
|
4
|
-
* See status of all bridges (X, Telegram, Discord, etc.) and manage connections.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const twitter = require('../twitter');
|
|
8
|
-
const telegram = require('../bridges/telegram');
|
|
9
|
-
const discord = require('../discord');
|
|
10
|
-
const farcaster = require('../bridges/farcaster');
|
|
11
|
-
const { requireInit, header, divider, success, warning } = require('./_shared');
|
|
12
|
-
|
|
13
|
-
const definition = {
|
|
14
|
-
name: 'vibe_bridges',
|
|
15
|
-
description: 'See status and manage bridges to external platforms (X, Telegram, Discord, etc.)',
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
platform: {
|
|
20
|
-
type: 'string',
|
|
21
|
-
enum: ['all', 'x', 'twitter', 'telegram', 'discord', 'farcaster'],
|
|
22
|
-
description: 'Show specific platform or all (default: all)'
|
|
23
|
-
},
|
|
24
|
-
action: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
enum: ['status', 'test'],
|
|
27
|
-
description: 'Action to perform (default: status)'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
async function handler(args) {
|
|
34
|
-
const initCheck = requireInit();
|
|
35
|
-
if (initCheck) return initCheck;
|
|
36
|
-
|
|
37
|
-
const { platform = 'all', action = 'status' } = args;
|
|
38
|
-
|
|
39
|
-
if (action === 'test') {
|
|
40
|
-
return handleTest(platform);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return handleStatus(platform);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function handleStatus(platform) {
|
|
47
|
-
let display = header('Bridge Status');
|
|
48
|
-
display += '\n\n';
|
|
49
|
-
|
|
50
|
-
const bridges = await getBridgeStatuses();
|
|
51
|
-
|
|
52
|
-
if (platform === 'all') {
|
|
53
|
-
// Show all bridges
|
|
54
|
-
for (const [name, status] of Object.entries(bridges)) {
|
|
55
|
-
display += formatBridgeStatus(name, status);
|
|
56
|
-
display += '\n';
|
|
57
|
-
}
|
|
58
|
-
} else {
|
|
59
|
-
// Show specific platform
|
|
60
|
-
const normalizedPlatform = platform === 'twitter' ? 'x' : platform;
|
|
61
|
-
const status = bridges[normalizedPlatform];
|
|
62
|
-
|
|
63
|
-
if (!status) {
|
|
64
|
-
return { display: `${header('Bridge Status')}\n\n_Unknown platform: ${platform}_` };
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
display += formatBridgeStatus(normalizedPlatform, status);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
display += '\n' + divider();
|
|
71
|
-
display += '**Setup guides:**\n';
|
|
72
|
-
display += '• X: Add credentials to config.json (paid API required for writing)\n';
|
|
73
|
-
display += '• Telegram: `vibe telegram-bot --action setup`\n';
|
|
74
|
-
display += '• Discord: Add DISCORD_WEBHOOK_URL to config (one-way only)\n';
|
|
75
|
-
display += '• Farcaster: Add NEYNAR_API_KEY + signer to config\n\n';
|
|
76
|
-
|
|
77
|
-
display += '**Test connections:**\n';
|
|
78
|
-
display += '• `vibe bridges --action test --platform telegram`\n';
|
|
79
|
-
display += '• `vibe bridges --action test --platform farcaster`\n';
|
|
80
|
-
display += '• `vibe x-mentions` (test X read)\n';
|
|
81
|
-
display += '• `vibe farcaster --action status` (test Farcaster)';
|
|
82
|
-
|
|
83
|
-
return { display };
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async function handleTest(platform) {
|
|
87
|
-
const normalizedPlatform = platform === 'twitter' ? 'x' : platform;
|
|
88
|
-
|
|
89
|
-
try {
|
|
90
|
-
switch (normalizedPlatform) {
|
|
91
|
-
case 'x':
|
|
92
|
-
return await testXBridge();
|
|
93
|
-
case 'telegram':
|
|
94
|
-
return await testTelegramBridge();
|
|
95
|
-
case 'discord':
|
|
96
|
-
return await testDiscordBridge();
|
|
97
|
-
case 'farcaster':
|
|
98
|
-
return await testFarcasterBridge();
|
|
99
|
-
default:
|
|
100
|
-
return { display: `Testing not implemented for ${platform} yet.` };
|
|
101
|
-
}
|
|
102
|
-
} catch (e) {
|
|
103
|
-
return {
|
|
104
|
-
display: `${header(`${platform} Test`)}\n\n_Error:_ ${e.message}`
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
async function getBridgeStatuses() {
|
|
110
|
-
const bridges = {};
|
|
111
|
-
|
|
112
|
-
// X/Twitter
|
|
113
|
-
bridges.x = {
|
|
114
|
-
configured: twitter.isConfigured(),
|
|
115
|
-
capabilities: { read: true, write: true, dm: true, media: true },
|
|
116
|
-
status: 'unknown',
|
|
117
|
-
notes: []
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
if (bridges.x.configured) {
|
|
121
|
-
try {
|
|
122
|
-
await twitter.getMe();
|
|
123
|
-
bridges.x.status = 'connected';
|
|
124
|
-
} catch (e) {
|
|
125
|
-
bridges.x.status = 'error';
|
|
126
|
-
bridges.x.notes.push(e.message);
|
|
127
|
-
}
|
|
128
|
-
} else {
|
|
129
|
-
bridges.x.status = 'not_configured';
|
|
130
|
-
bridges.x.notes.push('Need API credentials in config.json');
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Telegram
|
|
134
|
-
bridges.telegram = {
|
|
135
|
-
configured: telegram.isConfigured(),
|
|
136
|
-
capabilities: { read: true, write: true, dm: true, groups: true },
|
|
137
|
-
status: 'unknown',
|
|
138
|
-
notes: []
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
if (bridges.telegram.configured) {
|
|
142
|
-
try {
|
|
143
|
-
const botInfo = await telegram.getBotInfo();
|
|
144
|
-
bridges.telegram.status = 'connected';
|
|
145
|
-
bridges.telegram.botUsername = botInfo.username;
|
|
146
|
-
bridges.telegram.botName = botInfo.first_name;
|
|
147
|
-
} catch (e) {
|
|
148
|
-
bridges.telegram.status = 'error';
|
|
149
|
-
bridges.telegram.notes.push(e.message);
|
|
150
|
-
}
|
|
151
|
-
} else {
|
|
152
|
-
bridges.telegram.status = 'not_configured';
|
|
153
|
-
bridges.telegram.notes.push('Need TELEGRAM_BOT_TOKEN in config.json');
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Discord
|
|
157
|
-
bridges.discord = {
|
|
158
|
-
configured: discord.isConfigured(),
|
|
159
|
-
capabilities: { read: false, write: true, webhooks: true },
|
|
160
|
-
status: 'unknown',
|
|
161
|
-
notes: []
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
if (bridges.discord.configured) {
|
|
165
|
-
bridges.discord.status = 'connected';
|
|
166
|
-
bridges.discord.notes.push('Webhook configured (one-way: /vibe → Discord)');
|
|
167
|
-
} else {
|
|
168
|
-
bridges.discord.status = 'not_configured';
|
|
169
|
-
bridges.discord.notes.push('Need DISCORD_WEBHOOK_URL in config.json');
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// Farcaster
|
|
173
|
-
bridges.farcaster = {
|
|
174
|
-
configured: farcaster.isConfigured(),
|
|
175
|
-
capabilities: { read: true, write: true, channels: true, frames: true },
|
|
176
|
-
status: 'unknown',
|
|
177
|
-
notes: []
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
if (bridges.farcaster.configured) {
|
|
181
|
-
try {
|
|
182
|
-
const userInfo = await farcaster.getUser();
|
|
183
|
-
bridges.farcaster.status = 'connected';
|
|
184
|
-
bridges.farcaster.username = userInfo.users[0].username;
|
|
185
|
-
bridges.farcaster.fid = userInfo.users[0].fid;
|
|
186
|
-
} catch (e) {
|
|
187
|
-
bridges.farcaster.status = 'error';
|
|
188
|
-
bridges.farcaster.notes.push(e.message);
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
bridges.farcaster.status = 'not_configured';
|
|
192
|
-
bridges.farcaster.notes.push('Need NEYNAR_API_KEY, FARCASTER_SIGNER_UUID, and FARCASTER_FID');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return bridges;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function formatBridgeStatus(name, status) {
|
|
199
|
-
const statusIcons = {
|
|
200
|
-
connected: '✅',
|
|
201
|
-
error: '❌',
|
|
202
|
-
not_configured: '⚠️',
|
|
203
|
-
not_implemented: '🚧'
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
const icon = statusIcons[status.status] || '❓';
|
|
207
|
-
const displayName = name.toUpperCase();
|
|
208
|
-
|
|
209
|
-
let line = `${icon} **${displayName}** — ${status.status.replace('_', ' ')}`;
|
|
210
|
-
|
|
211
|
-
if (status.botUsername) {
|
|
212
|
-
line += ` (@${status.botUsername})`;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (status.username) {
|
|
216
|
-
line += ` (@${status.username})`;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
line += '\n';
|
|
220
|
-
|
|
221
|
-
// Show capabilities
|
|
222
|
-
const caps = [];
|
|
223
|
-
if (status.capabilities.read) caps.push('read');
|
|
224
|
-
if (status.capabilities.write) caps.push('write');
|
|
225
|
-
if (status.capabilities.dm) caps.push('dm');
|
|
226
|
-
if (status.capabilities.groups) caps.push('groups');
|
|
227
|
-
if (status.capabilities.channels) caps.push('channels');
|
|
228
|
-
if (status.capabilities.webhooks) caps.push('webhooks');
|
|
229
|
-
if (status.capabilities.media) caps.push('media');
|
|
230
|
-
if (status.capabilities.frames) caps.push('frames');
|
|
231
|
-
|
|
232
|
-
line += ` Capabilities: ${caps.join(', ')}\n`;
|
|
233
|
-
|
|
234
|
-
// Show notes/errors
|
|
235
|
-
for (const note of status.notes) {
|
|
236
|
-
line += ` _${note}_\n`;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return line;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
async function testXBridge() {
|
|
243
|
-
let display = header('X Bridge Test');
|
|
244
|
-
display += '\n\n';
|
|
245
|
-
|
|
246
|
-
if (!twitter.isConfigured()) {
|
|
247
|
-
display += warning('❌ X not configured\n\n');
|
|
248
|
-
display += 'Add X API credentials to ~/.vibecodings/config.json';
|
|
249
|
-
return { display };
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
try {
|
|
253
|
-
const me = await twitter.getMe();
|
|
254
|
-
display += success(`✅ Connected to X as @${me.data.username}\n\n`);
|
|
255
|
-
display += `**Account Info:**\n`;
|
|
256
|
-
display += `• Name: ${me.data.name}\n`;
|
|
257
|
-
display += `• Username: @${me.data.username}\n`;
|
|
258
|
-
display += `• ID: ${me.data.id}\n\n`;
|
|
259
|
-
|
|
260
|
-
display += divider();
|
|
261
|
-
display += '**Available features:**\n';
|
|
262
|
-
display += '• Read mentions: `vibe x-mentions`\n';
|
|
263
|
-
display += '• Send tweet: `vibe x-reply "message"`\n';
|
|
264
|
-
display += '• Reply to tweet: `vibe x-reply "reply" --reply_to TWEET_ID`';
|
|
265
|
-
|
|
266
|
-
} catch (e) {
|
|
267
|
-
display += `❌ Connection failed: ${e.message}\n\n`;
|
|
268
|
-
display += 'Check your API credentials and rate limits.';
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
return { display };
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
async function testTelegramBridge() {
|
|
275
|
-
let display = header('Telegram Bridge Test');
|
|
276
|
-
display += '\n\n';
|
|
277
|
-
|
|
278
|
-
if (!telegram.isConfigured()) {
|
|
279
|
-
display += warning('❌ Telegram not configured\n\n');
|
|
280
|
-
display += 'Run: `vibe telegram-bot --action setup`';
|
|
281
|
-
return { display };
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
try {
|
|
285
|
-
const botInfo = await telegram.getBotInfo();
|
|
286
|
-
display += success(`✅ Connected to Telegram as @${botInfo.username}\n\n`);
|
|
287
|
-
display += `**Bot Info:**\n`;
|
|
288
|
-
display += `• Name: ${botInfo.first_name}\n`;
|
|
289
|
-
display += `• Username: @${botInfo.username}\n`;
|
|
290
|
-
display += `• ID: ${botInfo.id}\n`;
|
|
291
|
-
display += `• Can join groups: ${botInfo.can_join_groups ? 'Yes' : 'No'}\n\n`;
|
|
292
|
-
|
|
293
|
-
display += divider();
|
|
294
|
-
display += '**Test sending a message:**\n';
|
|
295
|
-
display += '`vibe telegram-bot --action test --chat_id YOUR_CHAT_ID --message "hello"`\n\n';
|
|
296
|
-
display += '**Bot commands in Telegram:**\n';
|
|
297
|
-
display += '• `/status shipping` - Update /vibe status\n';
|
|
298
|
-
display += '• `/who` - See who\'s online\n';
|
|
299
|
-
display += '• `/ship` - Announce completion';
|
|
300
|
-
|
|
301
|
-
} catch (e) {
|
|
302
|
-
display += `❌ Connection failed: ${e.message}\n\n`;
|
|
303
|
-
display += 'Check your bot token.';
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return { display };
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
async function testDiscordBridge() {
|
|
310
|
-
let display = header('Discord Bridge Test');
|
|
311
|
-
display += '\n\n';
|
|
312
|
-
|
|
313
|
-
if (!discord.isConfigured()) {
|
|
314
|
-
display += warning('❌ Discord not configured\n\n');
|
|
315
|
-
display += 'Add DISCORD_WEBHOOK_URL to config.json';
|
|
316
|
-
return { display };
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
try {
|
|
320
|
-
const sent = await discord.post('🧪 Test from /vibe bridge system');
|
|
321
|
-
|
|
322
|
-
if (sent) {
|
|
323
|
-
display += success('✅ Discord webhook working!\n\n');
|
|
324
|
-
display += 'Test message sent to your Discord channel.\n\n';
|
|
325
|
-
display += divider();
|
|
326
|
-
display += '**Current features:**\n';
|
|
327
|
-
display += '• /vibe activity notifications → Discord\n';
|
|
328
|
-
display += '• Status updates → Discord\n';
|
|
329
|
-
display += '• One-way only (Discord → /vibe coming soon)';
|
|
330
|
-
} else {
|
|
331
|
-
display += '❌ Webhook failed to send\n\n';
|
|
332
|
-
display += 'Check your webhook URL.';
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
} catch (e) {
|
|
336
|
-
display += `❌ Test failed: ${e.message}\n\n`;
|
|
337
|
-
display += 'Check your webhook URL in config.json';
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
return { display };
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
async function testFarcasterBridge() {
|
|
344
|
-
let display = header('Farcaster Bridge Test');
|
|
345
|
-
display += '\n\n';
|
|
346
|
-
|
|
347
|
-
if (!farcaster.isConfigured()) {
|
|
348
|
-
display += warning('❌ Farcaster not configured\n\n');
|
|
349
|
-
display += 'Setup required:\n';
|
|
350
|
-
display += '1. Get API key from https://neynar.com\n';
|
|
351
|
-
display += '2. Create signer at https://docs.neynar.com/reference/developer-managed-signers\n';
|
|
352
|
-
display += '3. Add to config.json: NEYNAR_API_KEY, FARCASTER_SIGNER_UUID, FARCASTER_FID';
|
|
353
|
-
return { display };
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
try {
|
|
357
|
-
const userInfo = await farcaster.getUser();
|
|
358
|
-
const user = userInfo.users[0];
|
|
359
|
-
|
|
360
|
-
display += success(`✅ Connected to Farcaster as @${user.username}\n\n`);
|
|
361
|
-
display += `**Account Info:**\n`;
|
|
362
|
-
display += `• Name: ${user.display_name}\n`;
|
|
363
|
-
display += `• Username: @${user.username}\n`;
|
|
364
|
-
display += `• FID: ${user.fid}\n`;
|
|
365
|
-
display += `• Followers: ${user.follower_count}\n`;
|
|
366
|
-
display += `• Following: ${user.following_count}\n\n`;
|
|
367
|
-
|
|
368
|
-
display += divider();
|
|
369
|
-
display += '**Available features:**\n';
|
|
370
|
-
display += '• View feed: `vibe farcaster --action feed`\n';
|
|
371
|
-
display += '• Post cast: `vibe farcaster --action cast --text "gm!"`\n';
|
|
372
|
-
display += '• Browse channels: `vibe farcaster --action channels`\n';
|
|
373
|
-
display += '• Search: `vibe farcaster --action search --query "ethereum"`';
|
|
374
|
-
|
|
375
|
-
} catch (e) {
|
|
376
|
-
display += `❌ Connection failed: ${e.message}\n\n`;
|
|
377
|
-
display += 'Check your API key, signer UUID, and FID configuration.';
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
return { display };
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
module.exports = { definition, handler };
|
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe colorguess — Play a fun color guessing game with friends
|
|
3
|
-
*
|
|
4
|
-
* One player thinks of a color, others try to guess it with helpful hints!
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
const config = require('../config');
|
|
8
|
-
const store = require('../store');
|
|
9
|
-
const { createGamePayload } = require('../protocol');
|
|
10
|
-
const { requireInit, normalizeHandle } = require('./_shared');
|
|
11
|
-
|
|
12
|
-
// Color guessing game implementation
|
|
13
|
-
const colorguess = require('../games/colorguess');
|
|
14
|
-
|
|
15
|
-
const definition = {
|
|
16
|
-
name: 'vibe_colorguess',
|
|
17
|
-
description: 'Start or play a color guessing game. One player picks a color, others guess with hints!',
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
action: {
|
|
22
|
-
type: 'string',
|
|
23
|
-
description: 'Action to perform',
|
|
24
|
-
enum: ['start', 'join', 'color', 'guess', 'hint', 'view', 'colors']
|
|
25
|
-
},
|
|
26
|
-
room: {
|
|
27
|
-
type: 'string',
|
|
28
|
-
description: 'Game room name (default: general)'
|
|
29
|
-
},
|
|
30
|
-
color: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'Secret color to set (host only) or color to guess'
|
|
33
|
-
},
|
|
34
|
-
hint: {
|
|
35
|
-
type: 'string',
|
|
36
|
-
description: 'Hint to give (host only)'
|
|
37
|
-
},
|
|
38
|
-
invite: {
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Handle to invite to the game'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
required: ['action']
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Get color guessing game state from global store
|
|
49
|
-
*/
|
|
50
|
-
async function getGameState(room) {
|
|
51
|
-
try {
|
|
52
|
-
const key = `colorguess:${room}`;
|
|
53
|
-
const state = await store.get(key);
|
|
54
|
-
return state ? JSON.parse(state) : null;
|
|
55
|
-
} catch (e) {
|
|
56
|
-
console.error('[colorguess] Failed to get state:', e.message);
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Save color guessing game state to global store
|
|
63
|
-
*/
|
|
64
|
-
async function saveGameState(room, state) {
|
|
65
|
-
try {
|
|
66
|
-
const key = `colorguess:${room}`;
|
|
67
|
-
await store.set(key, JSON.stringify(state));
|
|
68
|
-
} catch (e) {
|
|
69
|
-
console.error('[colorguess] Failed to save state:', e.message);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Post game activity to board
|
|
75
|
-
*/
|
|
76
|
-
async function postGameActivity(action, room, player, details = '') {
|
|
77
|
-
const API_URL = process.env.VIBE_API_URL || 'https://www.slashvibe.dev';
|
|
78
|
-
|
|
79
|
-
try {
|
|
80
|
-
let content;
|
|
81
|
-
switch (action) {
|
|
82
|
-
case 'start':
|
|
83
|
-
content = `🎨 @${player} started a color guessing game in #${room}`;
|
|
84
|
-
break;
|
|
85
|
-
case 'win':
|
|
86
|
-
content = `🎉 @${player} guessed the color in #${room}: ${details}`;
|
|
87
|
-
break;
|
|
88
|
-
case 'complete':
|
|
89
|
-
content = `🎨 Color guessing game in #${room} ended. The color was: ${details}`;
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
return; // Don't post for every action
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
await fetch(`${API_URL}/api/board`, {
|
|
96
|
-
method: 'POST',
|
|
97
|
-
headers: { 'Content-Type': 'application/json' },
|
|
98
|
-
body: JSON.stringify({
|
|
99
|
-
author: 'games-agent',
|
|
100
|
-
content,
|
|
101
|
-
category: 'games'
|
|
102
|
-
})
|
|
103
|
-
});
|
|
104
|
-
} catch (e) {
|
|
105
|
-
console.error('[colorguess] Failed to post to board:', e.message);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Invite someone to play
|
|
111
|
-
*/
|
|
112
|
-
async function invitePlayer(myHandle, targetHandle, room) {
|
|
113
|
-
const them = normalizeHandle(targetHandle);
|
|
114
|
-
const message = `🎨 Hey! I started a color guessing game in #${room}. Want to join? Use \`vibe colorguess --action join --room ${room}\` to play!`;
|
|
115
|
-
await store.sendMessage(myHandle, them, message, 'dm');
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
async function handler(args) {
|
|
119
|
-
const initCheck = requireInit();
|
|
120
|
-
if (initCheck) return initCheck;
|
|
121
|
-
|
|
122
|
-
const { action, room = 'general', color, hint, invite } = args;
|
|
123
|
-
const myHandle = config.getHandle();
|
|
124
|
-
|
|
125
|
-
// Handle inviting someone
|
|
126
|
-
if (invite) {
|
|
127
|
-
await invitePlayer(myHandle, invite, room);
|
|
128
|
-
return {
|
|
129
|
-
display: `🎨 Invited @${normalizeHandle(invite)} to join the color guessing game in #${room}!`
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Get current game state
|
|
134
|
-
let gameState = await getGameState(room);
|
|
135
|
-
|
|
136
|
-
switch (action) {
|
|
137
|
-
case 'start':
|
|
138
|
-
// Create new game
|
|
139
|
-
gameState = colorguess.createInitialColorGuessState();
|
|
140
|
-
const addResult = colorguess.addPlayer(gameState, myHandle);
|
|
141
|
-
if (addResult.error) {
|
|
142
|
-
return { display: `Error: ${addResult.error}` };
|
|
143
|
-
}
|
|
144
|
-
gameState = addResult.gameState;
|
|
145
|
-
await saveGameState(room, gameState);
|
|
146
|
-
await postGameActivity('start', room, myHandle);
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
display: `## 🎨 Started Color Guessing Game in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}\n\nAs host, set your secret color with:\n\`vibe colorguess --action color --room ${room} --color red\`\n\nInvite friends:\n\`vibe colorguess --action join --room ${room} --invite @username\``
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
case 'join':
|
|
153
|
-
if (!gameState) {
|
|
154
|
-
return { display: `No color guessing game found in #${room}. Use \`vibe colorguess --action start --room ${room}\` to create one!` };
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const joinResult = colorguess.addPlayer(gameState, myHandle);
|
|
158
|
-
if (joinResult.error) {
|
|
159
|
-
return { display: `Error: ${joinResult.error}` };
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
gameState = joinResult.gameState;
|
|
163
|
-
await saveGameState(room, gameState);
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
display: `## 🎨 Joined Color Guessing Game in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}\n\nWaiting for the host to set a secret color and start the game!`
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
case 'color':
|
|
170
|
-
if (!gameState) {
|
|
171
|
-
return { display: `No color guessing game found in #${room}.` };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (!color) {
|
|
175
|
-
return { display: 'Please specify a --color to set as the secret!' };
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
const colorResult = colorguess.setSecretColor(gameState, color, myHandle);
|
|
179
|
-
if (colorResult.error) {
|
|
180
|
-
return { display: `Error: ${colorResult.error}` };
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
gameState = colorResult.gameState;
|
|
184
|
-
await saveGameState(room, gameState);
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
display: `## 🎨 Secret Color Set! in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}\n\nThe game has started! Other players can now guess your secret color.\nGive hints with: \`vibe colorguess --action hint --room ${room} --hint "warm and fiery"\``
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
case 'guess':
|
|
191
|
-
if (!gameState) {
|
|
192
|
-
return { display: `No color guessing game found in #${room}.` };
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (!color) {
|
|
196
|
-
return { display: 'Please specify a --color to guess!' };
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const guessResult = colorguess.makeGuess(gameState, color, myHandle);
|
|
200
|
-
if (guessResult.error) {
|
|
201
|
-
return { display: `Error: ${guessResult.error}` };
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
gameState = guessResult.gameState;
|
|
205
|
-
await saveGameState(room, gameState);
|
|
206
|
-
|
|
207
|
-
// Check if game ended
|
|
208
|
-
if (gameState.gameOver) {
|
|
209
|
-
if (gameState.winner) {
|
|
210
|
-
await postGameActivity('win', room, myHandle, `${colorguess.getColorEmoji(gameState.secretColor)} ${gameState.secretColor}`);
|
|
211
|
-
} else {
|
|
212
|
-
await postGameActivity('complete', room, 'system', `${colorguess.getColorEmoji(gameState.secretColor)} ${gameState.secretColor}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
let response = `## 🎨 Color Guessing Game in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}`;
|
|
217
|
-
|
|
218
|
-
if (gameState.gameOver) {
|
|
219
|
-
response += `\n\nGame over! Start a new game with \`vibe colorguess --action start --room ${room}\``;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return { display: response };
|
|
223
|
-
|
|
224
|
-
case 'hint':
|
|
225
|
-
if (!gameState) {
|
|
226
|
-
return { display: `No color guessing game found in #${room}.` };
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
if (!hint) {
|
|
230
|
-
return { display: 'Please provide a --hint for the players!' };
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
const hintResult = colorguess.addHint(gameState, hint, myHandle);
|
|
234
|
-
if (hintResult.error) {
|
|
235
|
-
return { display: `Error: ${hintResult.error}` };
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
gameState = hintResult.gameState;
|
|
239
|
-
await saveGameState(room, gameState);
|
|
240
|
-
|
|
241
|
-
return {
|
|
242
|
-
display: `## 🎨 Added Hint in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}\n\nGreat hint! Players can now use this to make better guesses.`
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
case 'view':
|
|
246
|
-
if (!gameState) {
|
|
247
|
-
return { display: `No color guessing game found in #${room}. Use \`vibe colorguess --action start --room ${room}\` to create one!` };
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
let viewResponse = `## 🎨 Color Guessing Game in #${room}\n\n${colorguess.formatColorGuessDisplay(gameState)}`;
|
|
251
|
-
|
|
252
|
-
if (gameState.phase === 'setup') {
|
|
253
|
-
viewResponse += `\n\n**Commands:**\n• Host: \`vibe colorguess --action color --room ${room} --color blue\`\n• Join: \`vibe colorguess --action join --room ${room}\``;
|
|
254
|
-
} else if (gameState.phase === 'guessing') {
|
|
255
|
-
viewResponse += `\n\n**Commands:**\n• Guess: \`vibe colorguess --action guess --room ${room} --color red\`\n• Hint (host): \`vibe colorguess --action hint --room ${room} --hint "like fire"\``;
|
|
256
|
-
} else {
|
|
257
|
-
viewResponse += `\n\nGame over! Start a new one with \`vibe colorguess --action start --room ${room}\``;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
return { display: viewResponse };
|
|
261
|
-
|
|
262
|
-
case 'colors':
|
|
263
|
-
const colors = colorguess.getValidColors();
|
|
264
|
-
const colorGroups = [];
|
|
265
|
-
for (let i = 0; i < colors.length; i += 8) {
|
|
266
|
-
const group = colors.slice(i, i + 8);
|
|
267
|
-
colorGroups.push(group.map(color => `${colorguess.getColorEmoji(color)} ${color}`).join(' '));
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
display: `## 🎨 Valid Colors\n\nYou can use any of these colors:\n\n${colorGroups.join('\n')}\n\n**Examples:**\n• \`--color red\`\n• \`--color turquoise\`\n• \`--color lavender\``
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
default:
|
|
275
|
-
return {
|
|
276
|
-
display: `## 🎨 Color Guessing Game\n\nA fun social guessing game!\n\n**How to play:**\n1. One player (host) thinks of a color\n2. Other players try to guess it\n3. Host gives hints to help\n\n**Commands:**\n• \`--action start\` - Create new game\n• \`--action join\` - Join existing game\n• \`--action color --color blue\` - Set secret color (host)\n• \`--action guess --color red\` - Make a guess\n• \`--action hint --hint "warm color"\` - Give hint (host)\n• \`--action view\` - View current game\n• \`--action colors\` - See all valid colors\n\nAdd \`--room [name]\` to play in different rooms!\n\`--invite @user\` to invite someone!`
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
module.exports = { definition, handler };
|