slashvibe-mcp 0.3.21 → 0.3.22
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/config.js +36 -31
- package/crypto.js +1 -6
- package/discord.js +19 -19
- 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/notify.js +39 -14
- package/package.json +27 -20
- 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/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/analytics.js +0 -107
- package/auth-store.js +0 -148
- package/auto-update.js +0 -130
- 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/notification-emitter.js +0 -77
- 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
package/tools/profile.js
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe profile — Manage your /vibe profile for better discovery
|
|
3
|
-
*
|
|
4
|
-
* Set up your profile so others can find you:
|
|
5
|
-
* - What you're building
|
|
6
|
-
* - Your interests (broad topics you care about)
|
|
7
|
-
* - Your tags (specific skills/technologies)
|
|
8
|
-
* - View and update your profile
|
|
9
|
-
*
|
|
10
|
-
* Commands:
|
|
11
|
-
* - profile view [@handle] — View your or someone's profile
|
|
12
|
-
* - profile building "what you're working on" — Set current project
|
|
13
|
-
* - profile interests "ai, startups, music" — Set interests (comma-separated)
|
|
14
|
-
* - profile tags "react, typescript, frontend" — Set skill tags
|
|
15
|
-
* - profile clear — Clear your profile data
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const config = require('../config');
|
|
19
|
-
const userProfiles = require('../store/profiles');
|
|
20
|
-
const { formatTimeAgo, requireInit } = require('./_shared');
|
|
21
|
-
|
|
22
|
-
const definition = {
|
|
23
|
-
name: 'vibe_profile',
|
|
24
|
-
description: 'Manage your profile for better discovery and connections.',
|
|
25
|
-
inputSchema: {
|
|
26
|
-
type: 'object',
|
|
27
|
-
properties: {
|
|
28
|
-
command: {
|
|
29
|
-
type: 'string',
|
|
30
|
-
enum: ['view', 'building', 'interests', 'tags', 'clear'],
|
|
31
|
-
description: 'Profile action to take'
|
|
32
|
-
},
|
|
33
|
-
value: {
|
|
34
|
-
type: 'string',
|
|
35
|
-
description: 'Value to set (for building, interests, tags)'
|
|
36
|
-
},
|
|
37
|
-
handle: {
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'Handle to view (for view command, defaults to you)'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// Format profile for display
|
|
46
|
-
function formatProfile(profile, isMe = false) {
|
|
47
|
-
const title = isMe ? 'Your Profile' : `@${profile.handle}'s Profile`;
|
|
48
|
-
let display = `## ${title}\n\n`;
|
|
49
|
-
|
|
50
|
-
// Building
|
|
51
|
-
if (profile.building) {
|
|
52
|
-
display += `🚀 **Building:** ${profile.building}\n\n`;
|
|
53
|
-
} else {
|
|
54
|
-
display += `🚀 **Building:** _Not set_\n\n`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Interests
|
|
58
|
-
if (profile.interests && profile.interests.length > 0) {
|
|
59
|
-
display += `💡 **Interests:** ${profile.interests.join(', ')}\n\n`;
|
|
60
|
-
} else {
|
|
61
|
-
display += `💡 **Interests:** _Not set_\n\n`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Tags/Skills
|
|
65
|
-
if (profile.tags && profile.tags.length > 0) {
|
|
66
|
-
display += `🏷️ **Skills/Tags:** ${profile.tags.join(', ')}\n\n`;
|
|
67
|
-
} else {
|
|
68
|
-
display += `🏷️ **Skills/Tags:** _Not set_\n\n`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Activity
|
|
72
|
-
if (profile.lastSeen) {
|
|
73
|
-
display += `🕐 **Last active:** ${formatTimeAgo(profile.lastSeen)}\n`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (profile.firstSeen) {
|
|
77
|
-
display += `📅 **Member since:** ${new Date(profile.firstSeen).toLocaleDateString()}\n`;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Ships
|
|
81
|
-
if (profile.ships && profile.ships.length > 0) {
|
|
82
|
-
display += `\n**Recent ships:**\n`;
|
|
83
|
-
profile.ships.slice(0, 3).forEach(ship => {
|
|
84
|
-
display += `• ${ship.what} _(${formatTimeAgo(ship.timestamp)})_\n`;
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Connections
|
|
89
|
-
if (profile.connections && profile.connections.length > 0) {
|
|
90
|
-
display += `\n**Connected to ${profile.connections.length} people**\n`;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return display;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async function handler(args) {
|
|
97
|
-
const initCheck = requireInit();
|
|
98
|
-
if (initCheck) return initCheck;
|
|
99
|
-
|
|
100
|
-
const myHandle = config.getHandle();
|
|
101
|
-
const command = args.command || 'view';
|
|
102
|
-
|
|
103
|
-
let display = '';
|
|
104
|
-
|
|
105
|
-
try {
|
|
106
|
-
switch (command) {
|
|
107
|
-
case 'view': {
|
|
108
|
-
const targetHandle = args.handle ? args.handle.replace('@', '') : myHandle;
|
|
109
|
-
const profile = await userProfiles.getProfile(targetHandle);
|
|
110
|
-
const isMe = targetHandle === myHandle;
|
|
111
|
-
|
|
112
|
-
display = formatProfile(profile, isMe);
|
|
113
|
-
|
|
114
|
-
if (isMe) {
|
|
115
|
-
display += `\n---\n`;
|
|
116
|
-
display += `**Update your profile:**\n`;
|
|
117
|
-
display += `• \`profile building "AI chat app"\`\n`;
|
|
118
|
-
display += `• \`profile interests "ai, startups, music"\`\n`;
|
|
119
|
-
display += `• \`profile tags "react, typescript, frontend"\`\n\n`;
|
|
120
|
-
display += `Better profiles = better connections! 🤝`;
|
|
121
|
-
} else {
|
|
122
|
-
display += `\n---\n`;
|
|
123
|
-
display += `**Connect:**\n`;
|
|
124
|
-
display += `• \`message @${targetHandle}\` to reach out\n`;
|
|
125
|
-
display += `• \`discover\` to find similar builders`;
|
|
126
|
-
}
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
case 'building': {
|
|
131
|
-
if (!args.value) {
|
|
132
|
-
return { error: 'Please specify what you\'re building: profile building "AI chat app"' };
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
await userProfiles.updateProfile(myHandle, { building: args.value });
|
|
136
|
-
|
|
137
|
-
display = `## Profile Updated\n\n`;
|
|
138
|
-
display += `🚀 **Now building:** ${args.value}\n\n`;
|
|
139
|
-
display += `Others can find you via:\n`;
|
|
140
|
-
display += `• \`discover search "${args.value.split(' ')[0]}"\`\n`;
|
|
141
|
-
display += `• Similar project recommendations\n\n`;
|
|
142
|
-
display += `**Next:** Set your interests and tags for better matches!`;
|
|
143
|
-
break;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
case 'interests': {
|
|
147
|
-
if (!args.value) {
|
|
148
|
-
return { error: 'Please specify interests: profile interests "ai, startups, music"' };
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const interests = args.value.split(',').map(s => s.trim()).filter(s => s);
|
|
152
|
-
await userProfiles.updateProfile(myHandle, { interests });
|
|
153
|
-
|
|
154
|
-
display = `## Profile Updated\n\n`;
|
|
155
|
-
display += `💡 **Interests:** ${interests.join(', ')}\n\n`;
|
|
156
|
-
display += `You'll now get matched with people who share:\n`;
|
|
157
|
-
interests.forEach(interest => {
|
|
158
|
-
display += `• ${interest}\n`;
|
|
159
|
-
});
|
|
160
|
-
display += `\n**Try:** \`discover suggest\` to see your matches!`;
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
case 'tags': {
|
|
165
|
-
if (!args.value) {
|
|
166
|
-
return { error: 'Please specify skill tags: profile tags "react, typescript, frontend"' };
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const tags = args.value.split(',').map(s => s.trim()).filter(s => s);
|
|
170
|
-
await userProfiles.updateProfile(myHandle, { tags });
|
|
171
|
-
|
|
172
|
-
display = `## Profile Updated\n\n`;
|
|
173
|
-
display += `🏷️ **Skills/Tags:** ${tags.join(', ')}\n\n`;
|
|
174
|
-
display += `You'll get matched with people who:\n`;
|
|
175
|
-
display += `• Share these skills\n`;
|
|
176
|
-
display += `• Have complementary skills\n`;
|
|
177
|
-
display += `• Are building similar things\n\n`;
|
|
178
|
-
display += `**Try:** \`discover active\` to see similar builders online now!`;
|
|
179
|
-
break;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
case 'clear': {
|
|
183
|
-
const emptyProfile = {
|
|
184
|
-
building: null,
|
|
185
|
-
interests: [],
|
|
186
|
-
tags: []
|
|
187
|
-
};
|
|
188
|
-
await userProfiles.updateProfile(myHandle, emptyProfile);
|
|
189
|
-
|
|
190
|
-
display = `## Profile Cleared\n\n`;
|
|
191
|
-
display += `Your profile data has been reset.\n\n`;
|
|
192
|
-
display += `**Set up again:**\n`;
|
|
193
|
-
display += `• \`profile building "what you're working on"\`\n`;
|
|
194
|
-
display += `• \`profile interests "topic1, topic2, topic3"\`\n`;
|
|
195
|
-
display += `• \`profile tags "skill1, skill2, skill3"\``;
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
default:
|
|
200
|
-
display = `## Profile Commands\n\n`;
|
|
201
|
-
display += `**View profiles:**\n`;
|
|
202
|
-
display += `• \`profile view\` — Your profile\n`;
|
|
203
|
-
display += `• \`profile view @handle\` — Someone else's profile\n\n`;
|
|
204
|
-
display += `**Update your profile:**\n`;
|
|
205
|
-
display += `• \`profile building "what you're working on"\`\n`;
|
|
206
|
-
display += `• \`profile interests "ai, startups, music"\`\n`;
|
|
207
|
-
display += `• \`profile tags "react, typescript, frontend"\`\n`;
|
|
208
|
-
display += `• \`profile clear\` — Reset your profile\n\n`;
|
|
209
|
-
display += `**Why profiles matter:**\n`;
|
|
210
|
-
display += `Better profiles = better connections through \`discover\`!`;
|
|
211
|
-
}
|
|
212
|
-
} catch (error) {
|
|
213
|
-
display = `## Profile Error\n\n${error.message}`;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return { display };
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
module.exports = { definition, handler };
|
package/tools/proof-of-work.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe_proof_of_work - Get unified proof-of-work summary for a user
|
|
3
|
-
*
|
|
4
|
-
* Shows the complete "proof of work" picture:
|
|
5
|
-
* - PAST: Artifacts created/sold, sessions shared
|
|
6
|
-
* - PRESENT: Live presence, current work
|
|
7
|
-
* - FUTURE: Gigs completed/posted, hire availability
|
|
8
|
-
* - UNIFIED: Vibe score, tier, proven skills
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const config = require('../config');
|
|
12
|
-
const { requireInit, normalizeHandle, displayHandle, header, divider, emptyState, formatTimeAgo } = require('./_shared');
|
|
13
|
-
const { actions, formatActions } = require('./_actions');
|
|
14
|
-
|
|
15
|
-
const BASE_URL = process.env.VIBE_API_URL || 'https://www.slashvibe.dev';
|
|
16
|
-
|
|
17
|
-
const definition = {
|
|
18
|
-
name: 'vibe_proof_of_work',
|
|
19
|
-
description: 'Get proof-of-work summary for a user. Shows artifacts, sessions, gigs, vibe score, and proven skills.',
|
|
20
|
-
inputSchema: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
handle: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'User handle to look up (default: yourself)'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
async function handler(args) {
|
|
32
|
-
const initCheck = requireInit();
|
|
33
|
-
if (initCheck) return initCheck;
|
|
34
|
-
|
|
35
|
-
const targetHandle = normalizeHandle(args.handle) || config.getHandle();
|
|
36
|
-
|
|
37
|
-
try {
|
|
38
|
-
const response = await fetch(`${BASE_URL}/api/proof-of-work?handle=${encodeURIComponent(targetHandle)}`);
|
|
39
|
-
const data = await response.json();
|
|
40
|
-
|
|
41
|
-
if (!data.success) {
|
|
42
|
-
return { display: `❌ ${data.error || 'Failed to fetch proof-of-work'}` };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const pow = data.proof_of_work;
|
|
46
|
-
const isSelf = targetHandle === config.getHandle();
|
|
47
|
-
|
|
48
|
-
// Build display
|
|
49
|
-
let display = header(`Proof of Work: ${displayHandle(targetHandle)}`, 2) + '\n\n';
|
|
50
|
-
|
|
51
|
-
// Vibe Score & Tier
|
|
52
|
-
display += `**Vibe Score:** ${pow.unified?.vibe_score || 0}\n`;
|
|
53
|
-
display += `**Tier:** ${formatTier(pow.unified?.tier)}\n\n`;
|
|
54
|
-
|
|
55
|
-
// ━━━ PAST ━━━
|
|
56
|
-
display += header('📜 PAST (Artifacts & Sessions)', 3) + '\n';
|
|
57
|
-
const past = pow.past || {};
|
|
58
|
-
display += `• **Artifacts Created:** ${past.artifacts_created || 0}\n`;
|
|
59
|
-
display += `• **Artifacts Sold:** ${past.artifacts_sold || 0}\n`;
|
|
60
|
-
display += `• **Revenue Earned:** $${((past.revenue_cents || 0) / 100).toFixed(2)}\n`;
|
|
61
|
-
display += `• **Sessions Shared:** ${past.sessions_shared || 0}\n\n`;
|
|
62
|
-
|
|
63
|
-
// ━━━ PRESENT ━━━
|
|
64
|
-
display += header('🟢 PRESENT (Live)', 3) + '\n';
|
|
65
|
-
const present = pow.present || {};
|
|
66
|
-
if (present.is_online) {
|
|
67
|
-
display += `• **Status:** Online\n`;
|
|
68
|
-
if (present.working_on) {
|
|
69
|
-
display += `• **Working on:** ${present.working_on}\n`;
|
|
70
|
-
}
|
|
71
|
-
if (present.project) {
|
|
72
|
-
display += `• **Project:** ${present.project}\n`;
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
display += `• **Status:** Offline\n`;
|
|
76
|
-
if (present.last_seen) {
|
|
77
|
-
display += `• **Last seen:** ${formatTimeAgo(present.last_seen)}\n`;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
display += '\n';
|
|
81
|
-
|
|
82
|
-
// ━━━ FUTURE ━━━
|
|
83
|
-
display += header('🚀 FUTURE (Gigs & Availability)', 3) + '\n';
|
|
84
|
-
const future = pow.future || {};
|
|
85
|
-
display += `• **Gigs Completed:** ${future.gigs_completed || 0}\n`;
|
|
86
|
-
display += `• **Gigs Posted:** ${future.gigs_posted || 0}\n`;
|
|
87
|
-
display += `• **Avg Rating:** ${future.avg_rating ? `${future.avg_rating.toFixed(1)}⭐` : 'No ratings yet'}\n`;
|
|
88
|
-
display += `• **Available for Hire:** ${future.available_for_hire ? 'Yes' : 'No'}\n\n`;
|
|
89
|
-
|
|
90
|
-
// ━━━ PROVEN SKILLS ━━━
|
|
91
|
-
const skills = pow.unified?.proven_skills || [];
|
|
92
|
-
if (skills.length > 0) {
|
|
93
|
-
display += header('🛠️ Proven Skills', 3) + '\n';
|
|
94
|
-
skills.slice(0, 10).forEach(skill => {
|
|
95
|
-
display += `• ${skill.name} (${skill.count} gig${skill.count !== 1 ? 's' : ''})\n`;
|
|
96
|
-
});
|
|
97
|
-
display += '\n';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// ━━━ SCORE BREAKDOWN ━━━
|
|
101
|
-
const breakdown = pow.unified?.score_breakdown;
|
|
102
|
-
if (breakdown) {
|
|
103
|
-
display += header('📊 Score Breakdown', 3) + '\n';
|
|
104
|
-
display += `• Gigs: ${breakdown.gigs || 0}\n`;
|
|
105
|
-
display += `• Artifacts: ${breakdown.artifacts || 0}\n`;
|
|
106
|
-
display += `• Sessions: ${breakdown.sessions || 0}\n`;
|
|
107
|
-
display += `• Invites: ${breakdown.invites || 0}\n`;
|
|
108
|
-
display += `• Ships: ${breakdown.ships || 0}\n`;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// CTA for self
|
|
112
|
-
if (isSelf) {
|
|
113
|
-
display += divider();
|
|
114
|
-
display += '💡 **Boost your score:** Complete gigs (+50), sell artifacts (+30), share sessions (+10)\n';
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Build result with tip actions
|
|
118
|
-
const result = { display };
|
|
119
|
-
result.actions = formatActions(actions.afterProofOfWork(targetHandle, isSelf));
|
|
120
|
-
|
|
121
|
-
return result;
|
|
122
|
-
|
|
123
|
-
} catch (e) {
|
|
124
|
-
console.error('[proof-of-work] Error:', e);
|
|
125
|
-
return { display: `❌ Failed to fetch proof-of-work: ${e.message}` };
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Format tier with emoji
|
|
131
|
-
*/
|
|
132
|
-
function formatTier(tier) {
|
|
133
|
-
const tiers = {
|
|
134
|
-
newcomer: '🌱 Newcomer',
|
|
135
|
-
rising: '📈 Rising',
|
|
136
|
-
proven: '✅ Proven',
|
|
137
|
-
established: '🏆 Established',
|
|
138
|
-
expert: '⭐ Expert',
|
|
139
|
-
legendary: '👑 Legendary'
|
|
140
|
-
};
|
|
141
|
-
return tiers[tier] || tier || 'Unknown';
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
module.exports = { definition, handler };
|
package/tools/pulse.js
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* vibe pulse — Lightweight presence check for inline display
|
|
3
|
-
*
|
|
4
|
-
* Returns a compact "mini card" showing who's online.
|
|
5
|
-
* Designed to be called periodically by Claude based on CLAUDE.md instructions.
|
|
6
|
-
*
|
|
7
|
-
* Unlike vibe_who (full presence), this is:
|
|
8
|
-
* - Faster (minimal data)
|
|
9
|
-
* - Compact (fits in a response footer)
|
|
10
|
-
* - Suggestive (gentle nudges to connect)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const config = require('../config');
|
|
14
|
-
const store = require('../store');
|
|
15
|
-
|
|
16
|
-
const definition = {
|
|
17
|
-
name: 'vibe_pulse',
|
|
18
|
-
description: 'Quick presence check for inline display. Returns compact mini card showing who\'s online. Call periodically (~every 5 messages) to maintain ambient awareness.',
|
|
19
|
-
inputSchema: {
|
|
20
|
-
type: 'object',
|
|
21
|
-
properties: {}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// Gentle nudge templates
|
|
26
|
-
const NUDGES = {
|
|
27
|
-
just_joined: [
|
|
28
|
-
"{handle} just joined — say hi?",
|
|
29
|
-
"{handle} is here! Quick wave?",
|
|
30
|
-
"New face: {handle} just arrived"
|
|
31
|
-
],
|
|
32
|
-
shipping: [
|
|
33
|
-
"{handle} is shipping — cheer them on?",
|
|
34
|
-
"{handle} in flow mode 🔥"
|
|
35
|
-
],
|
|
36
|
-
debugging: [
|
|
37
|
-
"{handle} debugging — maybe you can help?",
|
|
38
|
-
"{handle} stuck on something"
|
|
39
|
-
],
|
|
40
|
-
active: [
|
|
41
|
-
"{handle} is around",
|
|
42
|
-
"{handle} building right now"
|
|
43
|
-
],
|
|
44
|
-
multiple: [
|
|
45
|
-
"{count} builders online — you're not alone",
|
|
46
|
-
"{count} people vibing right now",
|
|
47
|
-
"Room's alive: {count} online"
|
|
48
|
-
]
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
function pickRandom(arr) {
|
|
52
|
-
return arr[Math.floor(Math.random() * arr.length)];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function formatNudge(template, vars) {
|
|
56
|
-
let result = template;
|
|
57
|
-
for (const [key, value] of Object.entries(vars)) {
|
|
58
|
-
result = result.replace(`{${key}}`, value);
|
|
59
|
-
}
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function getStatusEmoji(user) {
|
|
64
|
-
// Explicit mood takes priority
|
|
65
|
-
if (user.mood === '🔥' || user.mood === 'shipping') return '🔥';
|
|
66
|
-
if (user.mood === '🐛' || user.mood === 'debugging') return '🐛';
|
|
67
|
-
if (user.mood === '🧠' || user.mood === 'thinking') return '🧠';
|
|
68
|
-
if (user.mood === '🎉' || user.mood === 'celebrating') return '🎉';
|
|
69
|
-
if (user.mood === '🎧') return '🎧';
|
|
70
|
-
if (user.mood === '☕') return '☕';
|
|
71
|
-
|
|
72
|
-
// Infer from what they're building (one_liner)
|
|
73
|
-
const workingOn = (user.one_liner || '').toLowerCase();
|
|
74
|
-
if (workingOn.includes('ai') || workingOn.includes('agent') || workingOn.includes('llm')) return '🤖';
|
|
75
|
-
if (workingOn.includes('creative') || workingOn.includes('art') || workingOn.includes('design')) return '🎨';
|
|
76
|
-
if (workingOn.includes('game') || workingOn.includes('chess') || workingOn.includes('play')) return '🎮';
|
|
77
|
-
if (workingOn.includes('social') || workingOn.includes('chat') || workingOn.includes('message')) return '💬';
|
|
78
|
-
if (workingOn.includes('crypto') || workingOn.includes('web3') || workingOn.includes('token')) return '⛓️';
|
|
79
|
-
if (workingOn.includes('tool') || workingOn.includes('platform') || workingOn.includes('infra')) return '🛠️';
|
|
80
|
-
if (workingOn.includes('mobile') || workingOn.includes('app')) return '📱';
|
|
81
|
-
if (workingOn.includes('data') || workingOn.includes('analytics')) return '📊';
|
|
82
|
-
|
|
83
|
-
// Infer from builderMode
|
|
84
|
-
if (user.builderMode === 'deep-focus') return '🧘';
|
|
85
|
-
if (user.builderMode === 'shipping') return '🚀';
|
|
86
|
-
if (user.builderMode === 'exploring') return '🔍';
|
|
87
|
-
if (user.builderMode === 'focused') return '💻';
|
|
88
|
-
|
|
89
|
-
// Fallback to recency
|
|
90
|
-
const age = Date.now() - user.lastSeen;
|
|
91
|
-
if (age < 2 * 60 * 1000) return '⚡'; // Active < 2min
|
|
92
|
-
if (age < 5 * 60 * 1000) return '●'; // Recent < 5min
|
|
93
|
-
return '○'; // Idle
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function getUserState(user) {
|
|
97
|
-
const age = Date.now() - user.lastSeen;
|
|
98
|
-
|
|
99
|
-
// Check for just joined (< 2 min session)
|
|
100
|
-
if (user.firstSeen) {
|
|
101
|
-
const sessionDuration = (user.lastSeen - new Date(user.firstSeen).getTime()) / 60000;
|
|
102
|
-
if (sessionDuration < 2 && age < 2 * 60 * 1000) {
|
|
103
|
-
return 'just_joined';
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (user.mood === '🔥' || user.mood === 'shipping') return 'shipping';
|
|
108
|
-
if (user.mood === '🐛' || user.mood === 'debugging') return 'debugging';
|
|
109
|
-
|
|
110
|
-
return 'active';
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async function handler(args) {
|
|
114
|
-
// Check if initialized
|
|
115
|
-
if (!config.isInitialized()) {
|
|
116
|
-
return {
|
|
117
|
-
display: null,
|
|
118
|
-
empty: true,
|
|
119
|
-
reason: 'not_initialized'
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const myHandle = config.getHandle();
|
|
124
|
-
|
|
125
|
-
// Fetch presence and unread (wrap in Promise.resolve for local store compat)
|
|
126
|
-
const [users, unreadCount] = await Promise.all([
|
|
127
|
-
Promise.resolve(store.getActiveUsers()).catch(() => []),
|
|
128
|
-
Promise.resolve(store.getUnreadCount(myHandle)).catch(() => 0)
|
|
129
|
-
]);
|
|
130
|
-
|
|
131
|
-
const others = users.filter(u => u.handle !== myHandle);
|
|
132
|
-
|
|
133
|
-
// Empty room
|
|
134
|
-
if (others.length === 0 && unreadCount === 0) {
|
|
135
|
-
return {
|
|
136
|
-
display: null,
|
|
137
|
-
empty: true,
|
|
138
|
-
reason: 'no_one_online'
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Smart truncate: break at word boundary, add ellipsis if truncated
|
|
143
|
-
function smartTruncate(text, maxLen) {
|
|
144
|
-
if (!text || text.length <= maxLen) return text || '';
|
|
145
|
-
// Find last space before maxLen
|
|
146
|
-
const truncated = text.slice(0, maxLen);
|
|
147
|
-
const lastSpace = truncated.lastIndexOf(' ');
|
|
148
|
-
if (lastSpace > maxLen * 0.6) {
|
|
149
|
-
// Break at word if we're not losing too much
|
|
150
|
-
return truncated.slice(0, lastSpace) + '…';
|
|
151
|
-
}
|
|
152
|
-
return truncated.slice(0, maxLen - 1) + '…';
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Get short status label from what they're working on
|
|
156
|
-
function getStatusLabel(user) {
|
|
157
|
-
if (user.mood === '🔥' || user.mood === 'shipping') return 'shipping';
|
|
158
|
-
if (user.mood === '🐛' || user.mood === 'debugging') return 'debugging';
|
|
159
|
-
if (user.mood === '🧠' || user.mood === 'thinking') return 'thinking';
|
|
160
|
-
if (user.mood === '🎉' || user.mood === 'celebrating') return 'shipped!';
|
|
161
|
-
if (user.mood === '👥' || user.mood === 'pairing') return 'pairing';
|
|
162
|
-
if (user.mood === '🎧') return 'vibing';
|
|
163
|
-
if (user.note) return smartTruncate(user.note, 28);
|
|
164
|
-
if (user.one_liner) return smartTruncate(user.one_liner, 28);
|
|
165
|
-
return '';
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Build compact single-line summary optimized for collapsed view
|
|
169
|
-
// This ONE line must contain all key info since details get hidden
|
|
170
|
-
const topUsers = others.slice(0, 4);
|
|
171
|
-
const userChips = topUsers.map(u => `${getStatusEmoji(u)} ${u.handle}`).join(' · ');
|
|
172
|
-
const moreCount = others.length > 4 ? ` +${others.length - 4}` : '';
|
|
173
|
-
const dmsBadge = unreadCount > 0 ? `📬 ${unreadCount} · ` : '';
|
|
174
|
-
|
|
175
|
-
// Single summary line with all key info
|
|
176
|
-
let display = `${dmsBadge}☕ ${others.length} online — ${userChips}${moreCount}`;
|
|
177
|
-
|
|
178
|
-
// Generate nudge
|
|
179
|
-
let nudge = null;
|
|
180
|
-
if (others.length > 0) {
|
|
181
|
-
// Find most interesting user for nudge
|
|
182
|
-
const states = others.map(u => ({ user: u, state: getUserState(u) }));
|
|
183
|
-
|
|
184
|
-
// Priority: just_joined > shipping > debugging > active
|
|
185
|
-
const priority = ['just_joined', 'shipping', 'debugging', 'active'];
|
|
186
|
-
let picked = null;
|
|
187
|
-
|
|
188
|
-
for (const state of priority) {
|
|
189
|
-
picked = states.find(s => s.state === state);
|
|
190
|
-
if (picked) break;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (picked) {
|
|
194
|
-
const templates = NUDGES[picked.state] || NUDGES.active;
|
|
195
|
-
nudge = formatNudge(pickRandom(templates), {
|
|
196
|
-
handle: `@${picked.user.handle}`,
|
|
197
|
-
count: others.length
|
|
198
|
-
});
|
|
199
|
-
} else if (others.length >= 2) {
|
|
200
|
-
nudge = formatNudge(pickRandom(NUDGES.multiple), { count: others.length });
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// Add nudge after details
|
|
205
|
-
if (nudge) {
|
|
206
|
-
display += `\n\n_${nudge}_`;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
return {
|
|
210
|
-
display,
|
|
211
|
-
online_count: others.length,
|
|
212
|
-
unread_count: unreadCount,
|
|
213
|
-
nudge,
|
|
214
|
-
handles: others.slice(0, 5).map(u => u.handle)
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
module.exports = { definition, handler };
|