slashvibe-mcp 0.2.9 → 0.3.13

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 (205) hide show
  1. package/README.md +1 -0
  2. package/analytics.js +107 -0
  3. package/auth-store.js +148 -0
  4. package/auto-update.js +130 -0
  5. package/bridges/bridge-monitor.js +388 -0
  6. package/bridges/discord-bot.js +431 -0
  7. package/bridges/farcaster.js +299 -0
  8. package/bridges/telegram.js +261 -0
  9. package/bridges/webhook-health.js +420 -0
  10. package/bridges/webhook-server.js +437 -0
  11. package/bridges/whatsapp.js +441 -0
  12. package/bridges/x-webhook.js +423 -0
  13. package/config.js +154 -5
  14. package/crypto.js +3 -8
  15. package/games/arcade.js +406 -0
  16. package/games/chess.js +451 -0
  17. package/games/colorguess.js +343 -0
  18. package/games/crossword-words.js +171 -0
  19. package/games/crossword.js +461 -0
  20. package/games/drawing.js +347 -0
  21. package/games/gameroulette.js +300 -0
  22. package/games/gamerouter.js +336 -0
  23. package/games/gamestatus.js +337 -0
  24. package/games/guessnumber.js +209 -0
  25. package/games/hangman.js +279 -0
  26. package/games/memory.js +338 -0
  27. package/games/multiplayer-tictactoe.js +389 -0
  28. package/games/pixelart.js +399 -0
  29. package/games/quickduel.js +354 -0
  30. package/games/riddle.js +371 -0
  31. package/games/rockpaperscissors.js +291 -0
  32. package/games/snake.js +406 -0
  33. package/games/storybuilder.js +343 -0
  34. package/games/tictactoe.js +345 -0
  35. package/games/twentyquestions.js +286 -0
  36. package/games/twotruths.js +207 -0
  37. package/games/werewolf.js +508 -0
  38. package/games/wordassociation.js +247 -0
  39. package/games/wordchain.js +135 -0
  40. package/index.js +105 -216
  41. package/intelligence/index.js +45 -0
  42. package/intelligence/infer.js +316 -0
  43. package/intelligence/interests.js +369 -0
  44. package/intelligence/patterns.js +651 -0
  45. package/intelligence/proactive.js +358 -0
  46. package/intelligence/serendipity.js +306 -0
  47. package/memory.js +166 -0
  48. package/notification-emitter.js +77 -0
  49. package/notify.js +102 -1
  50. package/package.json +21 -7
  51. package/prompts.js +1 -1
  52. package/protocol/index.js +161 -1
  53. package/setup.js +402 -0
  54. package/store/api.js +528 -82
  55. package/store/profiles.js +160 -12
  56. package/tools/_actions.js +463 -16
  57. package/tools/_deprecated/auto-suggest-connections.js +304 -0
  58. package/tools/_deprecated/bootstrap-skills.js +231 -0
  59. package/tools/_deprecated/bridge-dashboard.js +342 -0
  60. package/tools/_deprecated/bridge-health.js +400 -0
  61. package/tools/_deprecated/bridge-live.js +384 -0
  62. package/tools/_deprecated/bridges.js +383 -0
  63. package/tools/_deprecated/colorguess.js +281 -0
  64. package/tools/_deprecated/discover-insights.js +379 -0
  65. package/tools/_deprecated/discover-momentum.js +256 -0
  66. package/tools/_deprecated/discovery-analytics.js +345 -0
  67. package/tools/_deprecated/discovery-auto-suggest.js +275 -0
  68. package/tools/_deprecated/discovery-bootstrap.js +267 -0
  69. package/tools/_deprecated/discovery-daily.js +375 -0
  70. package/tools/_deprecated/discovery-dashboard.js +385 -0
  71. package/tools/_deprecated/discovery-digest.js +314 -0
  72. package/tools/_deprecated/discovery-hub.js +357 -0
  73. package/tools/_deprecated/discovery-insights.js +384 -0
  74. package/tools/_deprecated/discovery-momentum.js +281 -0
  75. package/tools/_deprecated/discovery-monitor.js +319 -0
  76. package/tools/_deprecated/discovery-proactive.js +300 -0
  77. package/tools/_deprecated/draw.js +317 -0
  78. package/tools/_deprecated/farcaster.js +307 -0
  79. package/tools/_deprecated/forget.js +119 -0
  80. package/tools/_deprecated/games-catalog.js +376 -0
  81. package/tools/_deprecated/games.js +313 -0
  82. package/tools/_deprecated/guessnumber.js +194 -0
  83. package/tools/_deprecated/hangman.js +129 -0
  84. package/tools/_deprecated/multiplayer-tictactoe.js +303 -0
  85. package/tools/_deprecated/recall.js +147 -0
  86. package/tools/_deprecated/remember.js +86 -0
  87. package/tools/_deprecated/riddle.js +240 -0
  88. package/tools/_deprecated/run-bootstrap.js +69 -0
  89. package/tools/_deprecated/skills-analytics.js +349 -0
  90. package/tools/_deprecated/skills-bootstrap.js +301 -0
  91. package/tools/_deprecated/skills-dashboard.js +268 -0
  92. package/tools/_deprecated/skills.js +380 -0
  93. package/tools/_deprecated/smart-intro.js +353 -0
  94. package/tools/_deprecated/storybuilder.js +331 -0
  95. package/tools/_deprecated/telegram-bot.js +183 -0
  96. package/tools/_deprecated/telegram-setup.js +214 -0
  97. package/tools/_deprecated/twentyquestions.js +143 -0
  98. package/tools/_discovery-enhanced.js +290 -0
  99. package/tools/_discovery.js +439 -0
  100. package/tools/_proactive-discovery.js +301 -0
  101. package/tools/_shared/index.js +64 -0
  102. package/tools/_shared.js +234 -0
  103. package/tools/_work-context.js +338 -0
  104. package/tools/_work-context.manual-test.js +199 -0
  105. package/tools/_work-context.test.js +260 -0
  106. package/tools/activity.js +220 -0
  107. package/tools/admin-inbox.js +218 -0
  108. package/tools/agent-treasury.js +288 -0
  109. package/tools/analytics.js +191 -0
  110. package/tools/approve.js +197 -0
  111. package/tools/arcade.js +173 -0
  112. package/tools/artifact-create.js +17 -11
  113. package/tools/artifact-view.js +31 -1
  114. package/tools/artifacts-price.js +47 -43
  115. package/tools/ask-expert.js +160 -0
  116. package/tools/available.js +120 -0
  117. package/tools/become-expert.js +150 -0
  118. package/tools/broadcast.js +286 -0
  119. package/tools/chat.js +202 -0
  120. package/tools/collaborative-drawing.js +286 -0
  121. package/tools/connection-status.js +178 -0
  122. package/tools/crossword.js +17 -1
  123. package/tools/discover.js +350 -34
  124. package/tools/dm.js +115 -73
  125. package/tools/drawing.js +1 -1
  126. package/tools/earnings.js +126 -0
  127. package/tools/echo.js +16 -0
  128. package/tools/feed.js +51 -7
  129. package/tools/follow.js +224 -0
  130. package/tools/friends.js +207 -0
  131. package/tools/game.js +2 -2
  132. package/tools/genesis.js +233 -0
  133. package/tools/gig-browse.js +206 -0
  134. package/tools/gig-complete.js +144 -0
  135. package/tools/handoff.js +7 -1
  136. package/tools/help.js +4 -4
  137. package/tools/idea.js +9 -2
  138. package/tools/inbox.js +334 -28
  139. package/tools/init.js +727 -36
  140. package/tools/invite.js +15 -4
  141. package/tools/l2-bridge.js +272 -0
  142. package/tools/l2-status.js +217 -0
  143. package/tools/l2.js +206 -0
  144. package/tools/migrate.js +156 -0
  145. package/tools/mint.js +377 -0
  146. package/tools/multiplayer-game.js +1 -1
  147. package/tools/notifications.js +415 -0
  148. package/tools/observe.js +200 -0
  149. package/tools/onboarding.js +147 -0
  150. package/tools/open.js +143 -12
  151. package/tools/party-game.js +2 -2
  152. package/tools/plan.js +225 -0
  153. package/tools/presence-agent.js +7 -0
  154. package/tools/proof-of-work.js +100 -104
  155. package/tools/pulse.js +218 -0
  156. package/tools/reply.js +166 -0
  157. package/tools/report.js +2 -2
  158. package/tools/reputation.js +175 -0
  159. package/tools/request.js +17 -3
  160. package/tools/schedule.js +367 -0
  161. package/tools/search-messages.js +123 -0
  162. package/tools/session.js +420 -0
  163. package/tools/session_price.js +128 -0
  164. package/tools/settings.js +126 -3
  165. package/tools/ship.js +31 -8
  166. package/tools/shipback.js +326 -0
  167. package/tools/smart-check.js +201 -0
  168. package/tools/social-processor.js +445 -0
  169. package/tools/solo-game.js +1 -1
  170. package/tools/start.js +335 -93
  171. package/tools/status.js +53 -6
  172. package/tools/stuck.js +297 -0
  173. package/tools/subscribe.js +148 -0
  174. package/tools/subscriptions.js +134 -0
  175. package/tools/suggest-tags.js +6 -8
  176. package/tools/tag-suggestions.js +257 -0
  177. package/tools/tip.js +193 -0
  178. package/tools/token.js +103 -0
  179. package/tools/update.js +1 -1
  180. package/tools/wallet.js +239 -186
  181. package/tools/watch.js +157 -0
  182. package/tools/webhook-test.js +388 -0
  183. package/tools/who.js +54 -3
  184. package/tools/withdraw.js +145 -0
  185. package/tools/work-summary.js +96 -0
  186. package/tools/workshop.js +327 -0
  187. package/tools/x-mentions.js +1 -1
  188. package/version.json +14 -3
  189. package/tools/artifacts-buy.js +0 -111
  190. package/tools/connect.js +0 -284
  191. package/tools/gigs-apply.js +0 -99
  192. package/tools/gigs-browse.js +0 -114
  193. package/tools/gigs-complete.js +0 -128
  194. package/tools/gigs-post.js +0 -140
  195. package/tools/live-off.js +0 -109
  196. package/tools/live-watch.js +0 -176
  197. package/tools/live.js +0 -128
  198. package/tools/sessions-browse.js +0 -105
  199. package/tools/whats-happening.js +0 -125
  200. /package/tools/{away.js → _deprecated/away.js} +0 -0
  201. /package/tools/{back.js → _deprecated/back.js} +0 -0
  202. /package/tools/{mute.js → _deprecated/mute.js} +0 -0
  203. /package/tools/{skills-exchange.js → _deprecated/skills-exchange.js} +0 -0
  204. /package/tools/{tictactoe.js → _deprecated/tictactoe.js} +0 -0
  205. /package/tools/{wordassociation.js → _deprecated/wordassociation.js} +0 -0
package/README.md CHANGED
@@ -60,6 +60,7 @@ The MCP server connects to `slashvibe.dev` for:
60
60
 
61
61
  ## Related
62
62
 
63
+ - [GitHub](https://github.com/VibeCodingInc/vibe-mcp) - Source code
63
64
  - [slashvibe.dev](https://slashvibe.dev) - Web presence
64
65
  - [Spirit Protocol](https://spiritprotocol.io) - Parent ecosystem
65
66
  - [AIRC](https://airc.chat) - Agent identity protocol
package/analytics.js ADDED
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Analytics — Retention event tracking from MCP server
3
+ *
4
+ * Logs events to the /api/analytics/event endpoint for measuring
5
+ * user engagement and retention funnel performance.
6
+ *
7
+ * Usage:
8
+ * const analytics = require('./analytics');
9
+ * analytics.track('empty_inbox_action', { action: 'discover', source: 'inbox' });
10
+ */
11
+
12
+ const config = require('./config');
13
+
14
+ const API_URL = process.env.VIBE_API_URL || 'https://www.slashvibe.dev';
15
+
16
+ /**
17
+ * Track an analytics event (fire and forget)
18
+ * @param {string} eventType - Event type (from valid types in api/lib/events.js)
19
+ * @param {object} data - Additional event data
20
+ */
21
+ async function track(eventType, data = {}) {
22
+ const handle = config.getHandle();
23
+ if (!handle) return; // Skip if not initialized
24
+
25
+ try {
26
+ // Fire and forget - don't await or block
27
+ fetch(`${API_URL}/api/analytics/events`, {
28
+ method: 'POST',
29
+ headers: { 'Content-Type': 'application/json' },
30
+ body: JSON.stringify({
31
+ type: eventType,
32
+ handle,
33
+ data: {
34
+ ...data,
35
+ client: 'mcp-server',
36
+ timestamp: Date.now()
37
+ }
38
+ })
39
+ }).catch(() => {}); // Silently ignore errors
40
+ } catch (e) {
41
+ // Analytics should never block or fail user flows
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Track empty inbox interaction
47
+ * @param {string} action - Which action was taken (or 'none' if user closed)
48
+ * @param {object} context - Context about the state (hadOnboardingTask, hadRecentShips, etc.)
49
+ */
50
+ function trackEmptyInbox(action, context = {}) {
51
+ // Track that user reached empty inbox state
52
+ track('empty_inbox_reached', {
53
+ hadRecentThreads: context.recentThreads?.length > 0,
54
+ hadOnboardingTask: !!context.onboardingTask,
55
+ hadRecentShips: context.recentShips?.length > 0
56
+ });
57
+
58
+ // If an action was taken, track it
59
+ if (action && action !== 'none') {
60
+ track('empty_inbox_action', {
61
+ action,
62
+ ...context
63
+ });
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Track lurk mode state change
69
+ * @param {boolean} enabled - Whether lurk mode was enabled or disabled
70
+ */
71
+ function trackLurkMode(enabled) {
72
+ track(enabled ? 'lurk_mode_enabled' : 'lurk_mode_disabled', {});
73
+ }
74
+
75
+ /**
76
+ * Track onboarding task completion
77
+ * @param {string} taskId - The task that was completed
78
+ */
79
+ function trackOnboardingTask(taskId) {
80
+ track('onboarding_task_completed', { taskId });
81
+ }
82
+
83
+ /**
84
+ * Track discovery initiation
85
+ * @param {string} source - Where discovery was initiated from (inbox, start, etc.)
86
+ */
87
+ function trackDiscovery(source) {
88
+ track('discovery_initiated', { source });
89
+ }
90
+
91
+ /**
92
+ * Track session lifecycle
93
+ * @param {string} event - 'started' or 'ended'
94
+ * @param {object} sessionData - Session metrics (duration, actions, etc.)
95
+ */
96
+ function trackSession(event, sessionData = {}) {
97
+ track(event === 'started' ? 'session_started' : 'session_ended', sessionData);
98
+ }
99
+
100
+ module.exports = {
101
+ track,
102
+ trackEmptyInbox,
103
+ trackLurkMode,
104
+ trackOnboardingTask,
105
+ trackDiscovery,
106
+ trackSession
107
+ };
package/auth-store.js ADDED
@@ -0,0 +1,148 @@
1
+ /**
2
+ * Auth Store - In-memory singleton for authentication state
3
+ *
4
+ * This is the SOURCE OF TRUTH for auth during MCP runtime.
5
+ * File persistence (config.json) is only for durability across restarts.
6
+ *
7
+ * Why this exists:
8
+ * - OAuth callback and API calls happen in the same MCP process
9
+ * - File-based auth was unreliable due to per-PID session files and caching
10
+ * - In-memory state is immediate and deterministic
11
+ *
12
+ * Usage:
13
+ * - Startup: authStore.hydrate() loads from disk once
14
+ * - OAuth: authStore.setToken(token) updates immediately
15
+ * - API calls: authStore.getToken() returns current token (no file I/O)
16
+ */
17
+
18
+ // In-memory state - the single source of truth during runtime
19
+ let _token = null;
20
+ let _handle = null;
21
+ let _oneLiner = null;
22
+ let _hydrated = false;
23
+
24
+ /**
25
+ * Hydrate auth state from disk (call once at MCP startup)
26
+ * This loads persisted state from config.json
27
+ */
28
+ function hydrate() {
29
+ if (_hydrated) return; // Only hydrate once
30
+
31
+ try {
32
+ const config = require('./config');
33
+ const cfg = config.load();
34
+
35
+ _token = cfg.authToken || cfg.privyToken || null;
36
+ _handle = cfg.handle || cfg.username || null;
37
+ _oneLiner = cfg.one_liner || cfg.workingOn || null;
38
+ _hydrated = true;
39
+
40
+ if (_token) {
41
+ console.error('[auth-store] Hydrated from disk: @' + _handle);
42
+ } else {
43
+ console.error('[auth-store] Hydrated from disk: no token');
44
+ }
45
+ } catch (e) {
46
+ console.error('[auth-store] Hydration failed:', e.message);
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Set auth token (call after OAuth completes)
52
+ * @param {string} token - JWT token
53
+ */
54
+ function setToken(token) {
55
+ const hadToken = !!_token;
56
+ _token = token;
57
+
58
+ if (!hadToken && token) {
59
+ console.error('[auth-store] Token set (was empty)');
60
+ } else if (hadToken && token && token !== _token) {
61
+ console.error('[auth-store] Token updated');
62
+ }
63
+ }
64
+
65
+ /**
66
+ * Get current auth token
67
+ * @returns {string|null} Current token or null
68
+ */
69
+ function getToken() {
70
+ return _token;
71
+ }
72
+
73
+ /**
74
+ * Set user handle
75
+ * @param {string} handle - User handle (without @)
76
+ */
77
+ function setHandle(handle) {
78
+ _handle = handle;
79
+ }
80
+
81
+ /**
82
+ * Get current handle
83
+ * @returns {string|null} Current handle or null
84
+ */
85
+ function getHandle() {
86
+ return _handle;
87
+ }
88
+
89
+ /**
90
+ * Set one-liner (what user is building)
91
+ * @param {string} oneLiner - One-liner description
92
+ */
93
+ function setOneLiner(oneLiner) {
94
+ _oneLiner = oneLiner;
95
+ }
96
+
97
+ /**
98
+ * Get current one-liner
99
+ * @returns {string|null} Current one-liner or null
100
+ */
101
+ function getOneLiner() {
102
+ return _oneLiner;
103
+ }
104
+
105
+ /**
106
+ * Check if user is authenticated
107
+ * @returns {boolean} True if token exists
108
+ */
109
+ function isAuthenticated() {
110
+ return !!_token;
111
+ }
112
+
113
+ /**
114
+ * Clear all auth state (for logout/reset)
115
+ */
116
+ function clear() {
117
+ _token = null;
118
+ _handle = null;
119
+ _oneLiner = null;
120
+ console.error('[auth-store] Cleared');
121
+ }
122
+
123
+ /**
124
+ * Get full auth state (for debugging)
125
+ * @returns {object} Current auth state
126
+ */
127
+ function getState() {
128
+ return {
129
+ token: _token ? _token.substring(0, 20) + '...' : null,
130
+ handle: _handle,
131
+ oneLiner: _oneLiner,
132
+ hydrated: _hydrated,
133
+ isAuthenticated: !!_token
134
+ };
135
+ }
136
+
137
+ module.exports = {
138
+ hydrate,
139
+ setToken,
140
+ getToken,
141
+ setHandle,
142
+ getHandle,
143
+ setOneLiner,
144
+ getOneLiner,
145
+ isAuthenticated,
146
+ clear,
147
+ getState
148
+ };
package/auto-update.js ADDED
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Auto-update mechanism for /vibe MCP server
3
+ * Checks for updates and prompts user to update
4
+ */
5
+
6
+ const { exec } = require('child_process');
7
+ const { promisify } = require('util');
8
+ const fs = require('fs').promises;
9
+ const path = require('path');
10
+
11
+ const execAsync = promisify(exec);
12
+
13
+ async function checkForUpdates() {
14
+ try {
15
+ // Read local version
16
+ const versionPath = path.join(__dirname, 'version.json');
17
+ const localVersion = JSON.parse(await fs.readFile(versionPath, 'utf-8'));
18
+
19
+ // Check remote version
20
+ const response = await fetch('https://www.slashvibe.dev/api/version', {
21
+ headers: { 'User-Agent': 'vibe-mcp-client' }
22
+ });
23
+
24
+ if (!response.ok) {
25
+ return null; // Silent fail - don't block startup
26
+ }
27
+
28
+ const remoteVersion = await response.json();
29
+
30
+ // Compare versions
31
+ if (compareVersions(remoteVersion.version, localVersion.version) > 0) {
32
+ return {
33
+ current: localVersion.version,
34
+ latest: remoteVersion.version,
35
+ changelog: remoteVersion.changelog,
36
+ features: remoteVersion.features,
37
+ breaking: remoteVersion.breaking
38
+ };
39
+ }
40
+
41
+ return null; // Up to date
42
+ } catch (error) {
43
+ // Silent fail - don't block startup
44
+ return null;
45
+ }
46
+ }
47
+
48
+ async function performUpdate() {
49
+ try {
50
+ const repoPath = path.join(__dirname, '..');
51
+
52
+ // Check if we're in a git repo
53
+ try {
54
+ await execAsync('git rev-parse --git-dir', { cwd: repoPath });
55
+ } catch {
56
+ throw new Error('Not a git repository. Manual update required.');
57
+ }
58
+
59
+ // Stash any local changes
60
+ await execAsync('git stash', { cwd: repoPath });
61
+
62
+ // Pull latest
63
+ const { stdout, stderr } = await execAsync('git pull origin main', { cwd: repoPath });
64
+
65
+ // Pop stash if we had changes
66
+ try {
67
+ await execAsync('git stash pop', { cwd: repoPath });
68
+ } catch {
69
+ // No stash to pop, that's fine
70
+ }
71
+
72
+ return {
73
+ success: true,
74
+ output: stdout,
75
+ message: 'Update successful! Restart /vibe to apply changes.'
76
+ };
77
+ } catch (error) {
78
+ return {
79
+ success: false,
80
+ error: error.message
81
+ };
82
+ }
83
+ }
84
+
85
+ function compareVersions(v1, v2) {
86
+ const parts1 = v1.split('.').map(Number);
87
+ const parts2 = v2.split('.').map(Number);
88
+
89
+ for (let i = 0; i < 3; i++) {
90
+ if (parts1[i] > parts2[i]) return 1;
91
+ if (parts1[i] < parts2[i]) return -1;
92
+ }
93
+
94
+ return 0;
95
+ }
96
+
97
+ function formatUpdateNotification(update) {
98
+ if (!update) return null;
99
+
100
+ let message = `\n${'='.repeat(60)}\n`;
101
+ message += `📦 /vibe UPDATE AVAILABLE\n`;
102
+ message += `${'='.repeat(60)}\n\n`;
103
+ message += `Current: v${update.current}\n`;
104
+ message += `Latest: v${update.latest}${update.breaking ? ' ⚠️ BREAKING' : ''}\n\n`;
105
+ message += `${update.changelog}\n\n`;
106
+
107
+ if (update.features && update.features.length > 0) {
108
+ message += `New features:\n`;
109
+ update.features.forEach(f => {
110
+ message += ` • ${f}\n`;
111
+ });
112
+ message += `\n`;
113
+ }
114
+
115
+ message += `Update now:\n`;
116
+ message += ` vibe update\n`;
117
+ message += `\n`;
118
+ message += `Or manually:\n`;
119
+ message += ` cd ~/.vibe/vibe-repo && git pull origin main\n`;
120
+ message += `${'='.repeat(60)}\n`;
121
+
122
+ return message;
123
+ }
124
+
125
+ module.exports = {
126
+ checkForUpdates,
127
+ performUpdate,
128
+ compareVersions,
129
+ formatUpdateNotification
130
+ };