slashvibe-mcp 0.4.7 → 0.4.9

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 (239) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -55
  3. package/analytics.js +25 -1
  4. package/auto-update.js +10 -15
  5. package/config.js +44 -70
  6. package/crypto.js +1 -6
  7. package/debug.js +12 -0
  8. package/index.js +122 -329
  9. package/intelligence/index.js +1 -23
  10. package/intelligence/infer.js +10 -16
  11. package/intelligence/serendipity.js +57 -20
  12. package/notification-emitter.js +2 -2
  13. package/notify.js +39 -76
  14. package/package.json +55 -29
  15. package/presence.js +39 -2
  16. package/prompts.js +5 -9
  17. package/scripts/install-editors.js +258 -0
  18. package/scripts/sync-version.js +39 -0
  19. package/store/api.js +401 -528
  20. package/store/local.js +9 -10
  21. package/store/sessions.js +280 -0
  22. package/store/sqlite.js +360 -0
  23. package/tools/_actions.js +13 -749
  24. package/tools/_shared/index.js +41 -64
  25. package/tools/discover.js +47 -643
  26. package/tools/dm.js +11 -185
  27. package/tools/help.js +23 -253
  28. package/tools/inbox.js +10 -384
  29. package/tools/init.js +60 -435
  30. package/tools/ship.js +12 -87
  31. package/tools/start.js +50 -429
  32. package/tools/status.js +6 -93
  33. package/tools/who.js +71 -270
  34. package/version.json +5 -10
  35. package/auth-store.js +0 -158
  36. package/bridges/bridge-monitor.js +0 -388
  37. package/bridges/discord-bot.js +0 -431
  38. package/bridges/farcaster.js +0 -299
  39. package/bridges/telegram.js +0 -261
  40. package/bridges/webhook-health.js +0 -420
  41. package/bridges/webhook-server.js +0 -437
  42. package/bridges/whatsapp.js +0 -441
  43. package/bridges/x-webhook.js +0 -423
  44. package/discord.js +0 -170
  45. package/games/arcade.js +0 -406
  46. package/games/chess.js +0 -451
  47. package/games/colorguess.js +0 -343
  48. package/games/crossword-words.js +0 -171
  49. package/games/crossword.js +0 -461
  50. package/games/drawing.js +0 -347
  51. package/games/gameroulette.js +0 -300
  52. package/games/gamerouter.js +0 -336
  53. package/games/gamestatus.js +0 -337
  54. package/games/guessnumber.js +0 -209
  55. package/games/hangman.js +0 -279
  56. package/games/memory.js +0 -338
  57. package/games/multiplayer-tictactoe.js +0 -389
  58. package/games/pixelart.js +0 -399
  59. package/games/quickduel.js +0 -354
  60. package/games/riddle.js +0 -371
  61. package/games/rockpaperscissors.js +0 -291
  62. package/games/snake.js +0 -406
  63. package/games/storybuilder.js +0 -343
  64. package/games/tictactoe.js +0 -345
  65. package/games/twentyquestions.js +0 -286
  66. package/games/twotruths.js +0 -207
  67. package/games/werewolf.js +0 -508
  68. package/games/wordassociation.js +0 -247
  69. package/games/wordchain.js +0 -135
  70. package/intelligence/interests.js +0 -369
  71. package/intelligence/patterns.js +0 -651
  72. package/intelligence/proactive.js +0 -358
  73. package/memory.js +0 -166
  74. package/protocol/index.js +0 -500
  75. package/protocol/telegram-commands.js +0 -199
  76. package/setup.js +0 -480
  77. package/smart-inbox.js +0 -276
  78. package/store/profiles.js +0 -435
  79. package/store/reservations.js +0 -321
  80. package/store/skills.js +0 -378
  81. package/tools/_connection-queue.js +0 -257
  82. package/tools/_deprecated/auto-suggest-connections.js +0 -304
  83. package/tools/_deprecated/away.js +0 -68
  84. package/tools/_deprecated/back.js +0 -51
  85. package/tools/_deprecated/bootstrap-skills.js +0 -231
  86. package/tools/_deprecated/bridge-dashboard.js +0 -342
  87. package/tools/_deprecated/bridge-health.js +0 -400
  88. package/tools/_deprecated/bridge-live.js +0 -384
  89. package/tools/_deprecated/bridges.js +0 -383
  90. package/tools/_deprecated/colorguess.js +0 -281
  91. package/tools/_deprecated/discover-insights.js +0 -379
  92. package/tools/_deprecated/discover-momentum.js +0 -256
  93. package/tools/_deprecated/discovery-analytics.js +0 -345
  94. package/tools/_deprecated/discovery-auto-suggest.js +0 -275
  95. package/tools/_deprecated/discovery-bootstrap.js +0 -267
  96. package/tools/_deprecated/discovery-daily.js +0 -375
  97. package/tools/_deprecated/discovery-dashboard.js +0 -385
  98. package/tools/_deprecated/discovery-digest.js +0 -314
  99. package/tools/_deprecated/discovery-hub.js +0 -357
  100. package/tools/_deprecated/discovery-insights.js +0 -384
  101. package/tools/_deprecated/discovery-momentum.js +0 -281
  102. package/tools/_deprecated/discovery-monitor.js +0 -319
  103. package/tools/_deprecated/discovery-proactive.js +0 -300
  104. package/tools/_deprecated/draw.js +0 -317
  105. package/tools/_deprecated/farcaster.js +0 -307
  106. package/tools/_deprecated/forget.js +0 -119
  107. package/tools/_deprecated/games-catalog.js +0 -376
  108. package/tools/_deprecated/games.js +0 -313
  109. package/tools/_deprecated/guessnumber.js +0 -194
  110. package/tools/_deprecated/hangman.js +0 -129
  111. package/tools/_deprecated/multiplayer-tictactoe.js +0 -303
  112. package/tools/_deprecated/mute.js +0 -97
  113. package/tools/_deprecated/recall.js +0 -147
  114. package/tools/_deprecated/remember.js +0 -86
  115. package/tools/_deprecated/riddle.js +0 -240
  116. package/tools/_deprecated/run-bootstrap.js +0 -69
  117. package/tools/_deprecated/skills-analytics.js +0 -349
  118. package/tools/_deprecated/skills-bootstrap.js +0 -301
  119. package/tools/_deprecated/skills-dashboard.js +0 -268
  120. package/tools/_deprecated/skills-exchange.js +0 -342
  121. package/tools/_deprecated/skills.js +0 -380
  122. package/tools/_deprecated/smart-intro.js +0 -353
  123. package/tools/_deprecated/storybuilder.js +0 -331
  124. package/tools/_deprecated/telegram-bot.js +0 -183
  125. package/tools/_deprecated/telegram-setup.js +0 -214
  126. package/tools/_deprecated/tictactoe.js +0 -155
  127. package/tools/_deprecated/twentyquestions.js +0 -143
  128. package/tools/_deprecated/wordassociation.js +0 -247
  129. package/tools/_discovery-enhanced.js +0 -290
  130. package/tools/_discovery.js +0 -439
  131. package/tools/_proactive-discovery.js +0 -301
  132. package/tools/_shared.js +0 -234
  133. package/tools/_work-context.js +0 -338
  134. package/tools/_work-context.manual-test.js +0 -199
  135. package/tools/_work-context.test.js +0 -260
  136. package/tools/activity.js +0 -220
  137. package/tools/admin-inbox.js +0 -218
  138. package/tools/agent-treasury.js +0 -288
  139. package/tools/agents.js +0 -122
  140. package/tools/analytics.js +0 -191
  141. package/tools/approve.js +0 -197
  142. package/tools/arcade.js +0 -173
  143. package/tools/artifact-create.js +0 -247
  144. package/tools/artifact-view.js +0 -174
  145. package/tools/artifacts-price.js +0 -107
  146. package/tools/ask-expert.js +0 -160
  147. package/tools/available.js +0 -120
  148. package/tools/become-expert.js +0 -150
  149. package/tools/broadcast.js +0 -325
  150. package/tools/bye.js +0 -52
  151. package/tools/call.js +0 -144
  152. package/tools/cc-insights.js +0 -320
  153. package/tools/chat.js +0 -202
  154. package/tools/collaborative-drawing.js +0 -286
  155. package/tools/connection-status.js +0 -178
  156. package/tools/consent.js +0 -114
  157. package/tools/context.js +0 -132
  158. package/tools/crossword.js +0 -369
  159. package/tools/doctor.js +0 -481
  160. package/tools/drawing.js +0 -310
  161. package/tools/earnings.js +0 -126
  162. package/tools/echo.js +0 -218
  163. package/tools/feed.js +0 -227
  164. package/tools/follow.js +0 -224
  165. package/tools/forked.js +0 -301
  166. package/tools/friends.js +0 -207
  167. package/tools/game.js +0 -359
  168. package/tools/genesis.js +0 -233
  169. package/tools/gig-browse.js +0 -206
  170. package/tools/gig-complete.js +0 -144
  171. package/tools/guest-session.js +0 -118
  172. package/tools/handoff.js +0 -239
  173. package/tools/health.js +0 -87
  174. package/tools/idea.js +0 -217
  175. package/tools/insights.js +0 -123
  176. package/tools/invite.js +0 -228
  177. package/tools/l2-bridge.js +0 -272
  178. package/tools/l2-status.js +0 -217
  179. package/tools/l2.js +0 -206
  180. package/tools/leaderboard.js +0 -117
  181. package/tools/lib/git-apply.js +0 -206
  182. package/tools/lib/git-bundle.js +0 -407
  183. package/tools/migrate.js +0 -156
  184. package/tools/mint.js +0 -377
  185. package/tools/multiplayer-game.js +0 -275
  186. package/tools/notifications.js +0 -415
  187. package/tools/observe.js +0 -200
  188. package/tools/onboarding.js +0 -147
  189. package/tools/open.js +0 -258
  190. package/tools/pair.js +0 -124
  191. package/tools/party-game.js +0 -314
  192. package/tools/patterns.js +0 -79
  193. package/tools/ping.js +0 -51
  194. package/tools/plan.js +0 -225
  195. package/tools/presence-agent.js +0 -167
  196. package/tools/profile.js +0 -219
  197. package/tools/proof-of-work.js +0 -144
  198. package/tools/pulse.js +0 -218
  199. package/tools/react.js +0 -115
  200. package/tools/release.js +0 -83
  201. package/tools/reply.js +0 -166
  202. package/tools/report.js +0 -109
  203. package/tools/reputation.js +0 -175
  204. package/tools/request.js +0 -231
  205. package/tools/reservations.js +0 -116
  206. package/tools/reserve.js +0 -111
  207. package/tools/schedule.js +0 -367
  208. package/tools/search-messages.js +0 -123
  209. package/tools/session.js +0 -654
  210. package/tools/session_price.js +0 -128
  211. package/tools/settings.js +0 -200
  212. package/tools/shipback.js +0 -326
  213. package/tools/smart-check.js +0 -201
  214. package/tools/social-inbox.js +0 -437
  215. package/tools/social-post.js +0 -326
  216. package/tools/social-processor.js +0 -445
  217. package/tools/solo-game.js +0 -390
  218. package/tools/streak.js +0 -147
  219. package/tools/stuck.js +0 -297
  220. package/tools/submit.js +0 -98
  221. package/tools/subscribe.js +0 -148
  222. package/tools/subscriptions.js +0 -134
  223. package/tools/suggest-tags.js +0 -184
  224. package/tools/summarize.js +0 -195
  225. package/tools/tag-suggestions.js +0 -257
  226. package/tools/test.js +0 -182
  227. package/tools/tip.js +0 -193
  228. package/tools/token.js +0 -103
  229. package/tools/update.js +0 -105
  230. package/tools/wallet.js +0 -269
  231. package/tools/watch.js +0 -177
  232. package/tools/webhook-test.js +0 -388
  233. package/tools/withdraw.js +0 -145
  234. package/tools/work-summary.js +0 -96
  235. package/tools/workshop-buddy.js +0 -394
  236. package/tools/workshop.js +0 -327
  237. package/tools/x-mentions.js +0 -84
  238. package/tools/x-reply.js +0 -82
  239. package/twitter.js +0 -209
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Slash Vibe, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,83 +1,108 @@
1
- # vibe-mcp
1
+ # /vibe MCP Server
2
2
 
3
- Social layer for AI-assisted coding. DMs, presence, and connection between developers.
3
+ [![npm version](https://img.shields.io/npm/v/slashvibe-mcp.svg)](https://www.npmjs.com/package/slashvibe-mcp)
4
+ [![npm downloads](https://img.shields.io/npm/dw/slashvibe-mcp.svg)](https://www.npmjs.com/package/slashvibe-mcp)
5
+ [![CI](https://github.com/VibeCodingInc/vibe-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/VibeCodingInc/vibe-mcp/actions/workflows/ci.yml)
6
+ [![license](https://img.shields.io/npm/l/slashvibe-mcp.svg)](./LICENSE)
7
+ [![node](https://img.shields.io/node/v/slashvibe-mcp.svg)](https://nodejs.org)
8
+ [![MCP](https://img.shields.io/badge/MCP-compatible-blue)](https://modelcontextprotocol.io)
9
+ [![Smithery](https://smithery.ai/badge/slashvibe-mcp)](https://smithery.ai/server/slashvibe-mcp)
4
10
 
5
- **Works in:** Claude Code Cursor Any MCP-compatible IDE
11
+ Social MCP server — DMs, presence, and discovery for AI-assisted developers. See who's building, message them, share what you shipped. Works with Claude Code, Cursor, VS Code, Windsurf, and any MCP client.
6
12
 
7
- ## Quick Start
13
+ ## Install
8
14
 
9
- **Claude Code:**
10
15
  ```bash
11
- npx slashvibe-mcp setup
16
+ claude mcp add vibe -- npx -y slashvibe-mcp
12
17
  ```
13
18
 
14
- **Cursor:** See [Cursor Setup Guide](docs/CURSOR_SETUP.md)
19
+ <details>
20
+ <summary><strong>Other editors</strong></summary>
15
21
 
16
- **Other IDEs:** Any editor supporting MCP protocol can use the manual config below.
22
+ **Cursor** add to `~/.cursor/mcp.json`:
23
+ ```json
24
+ { "mcpServers": { "vibe": { "command": "npx", "args": ["-y", "slashvibe-mcp"] } } }
25
+ ```
17
26
 
18
- ## Installation
27
+ **VS Code** — add to `.vscode/mcp.json`:
28
+ ```json
29
+ { "servers": { "vibe": { "command": "npx", "args": ["-y", "slashvibe-mcp"] } } }
30
+ ```
19
31
 
20
- ```bash
21
- # Install globally
22
- npm install -g vibe-mcp
32
+ **Windsurf** — add to `~/.codeium/windsurf/mcp_config.json`:
33
+ ```json
34
+ { "mcpServers": { "vibe": { "command": "npx", "args": ["-y", "slashvibe-mcp"] } } }
35
+ ```
36
+
37
+ **Cline** — MCP Servers > Configure > Edit JSON, add `vibe` server as above.
23
38
 
24
- # Or add to Claude Code MCP config
25
- claude mcp add vibe-mcp
39
+ **Continue.dev** create `.continue/mcpServers/vibe.json`:
40
+ ```json
41
+ { "command": "npx", "args": ["-y", "slashvibe-mcp"] }
26
42
  ```
27
43
 
28
- ## Manual Setup
44
+ **JetBrains** Settings > Tools > AI Assistant > MCP, command `npx`, args `-y slashvibe-mcp`.
45
+ </details>
29
46
 
30
- Add to `~/.claude.json`:
47
+ ## Getting Started
31
48
 
32
- ```json
33
- {
34
- "mcpServers": {
35
- "vibe": {
36
- "command": "npx",
37
- "args": ["vibe-mcp"],
38
- "env": {
39
- "VIBE_API_URL": "https://www.slashvibe.dev"
40
- }
41
- }
42
- }
43
- }
49
+ ```
50
+ "let's vibe"
44
51
  ```
45
52
 
46
- ## Features
53
+ That's it. Authenticates via GitHub, shows who's online, checks your inbox.
47
54
 
48
- - **Presence** - See who's online building with Claude Code
49
- - **DMs** - Direct messages between developers
50
- - **Memory** - Remember context about connections
51
- - **Status** - Share what you're working on
52
- - **Games** - Play tic-tac-toe while coding
55
+ ## Tools
53
56
 
54
- ## Commands
57
+ | Tool | What it does |
58
+ |------|-------------|
59
+ | `vibe_start` | Entry point — authenticates, shows presence, checks inbox |
60
+ | `vibe_init` | Set up your identity (GitHub OAuth) |
61
+ | `vibe_who` | See who's online and what they're building |
62
+ | `vibe_dm` | Send a direct message |
63
+ | `vibe_inbox` | Check your unread messages |
64
+ | `vibe_status` | Set your mood (shipping, thinking, debugging, etc.) |
65
+ | `vibe_ship` | Share what you shipped |
66
+ | `vibe_discover` | Find people building similar things |
67
+ | `vibe_help` | Show available commands |
55
68
 
56
- Once installed, use these in Claude Code:
69
+ ## How It Works
57
70
 
58
- | Command | Description |
59
- |---------|-------------|
60
- | `vibe` | Check inbox and see who's online |
61
- | `vibe who` | List online users |
62
- | `vibe dm @handle "message"` | Send a DM |
63
- | `vibe status shipping` | Set your status |
64
- | `vibe remember @handle "note"` | Save a memory |
65
- | `vibe recall @handle` | Recall memories |
71
+ ```
72
+ Your Editor <-> /vibe MCP (stdio) <-> slashvibe.dev API <-> Other users
73
+ ```
74
+
75
+ - **Presence** broadcasts via heartbeat others see you in real time
76
+ - **Messages** are delivered through the slashvibe.dev API
77
+ - **Identity** persists via GitHub OAuth your handle follows you across editors
78
+
79
+ ## Troubleshooting
66
80
 
67
- ## API
81
+ **"I installed but don't see /vibe tools"** — restart your editor after adding the MCP config.
68
82
 
69
- The MCP server connects to `slashvibe.dev` for:
70
- - User presence and discovery
71
- - Message routing
72
- - Identity verification
83
+ **"Authentication failed"** OAuth opens a browser window. If it didn't open, go to [slashvibe.dev/login](https://slashvibe.dev/login). The callback runs on `localhost:9876` — make sure that port is free.
73
84
 
74
- ## Related
85
+ ## Development
86
+
87
+ ```bash
88
+ npm install
89
+ npm test
90
+ npm run lint
91
+ ```
75
92
 
76
- - [GitHub](https://github.com/VibeCodingInc/vibe-mcp) - Source code
77
- - [slashvibe.dev](https://slashvibe.dev) - Web presence
78
- - [Spirit Protocol](https://spiritprotocol.io) - Parent ecosystem
79
- - [AIRC](https://airc.chat) - Agent identity protocol
93
+ ## Contributing
94
+
95
+ We welcome contributions. See [CLA.md](./CLA.md) before submitting pull requests.
80
96
 
81
97
  ## License
82
98
 
83
- MIT
99
+ MIT — see [LICENSE](./LICENSE)
100
+
101
+ ## Links
102
+
103
+ - [slashvibe.dev](https://slashvibe.dev)
104
+ - [@slashvibe on X](https://twitter.com/slashvibe)
105
+
106
+ ---
107
+
108
+ Built by [Slash Vibe, Inc.](https://slashvibe.dev)
package/analytics.js CHANGED
@@ -97,11 +97,35 @@ function trackSession(event, sessionData = {}) {
97
97
  track(event === 'started' ? 'session_started' : 'session_ended', sessionData);
98
98
  }
99
99
 
100
+ /**
101
+ * Track editor install via universal installer
102
+ * @param {string} editor - Editor name configured
103
+ * @param {string} status - 'configured', 'exists', 'error'
104
+ */
105
+ function trackInstall(editor, status) {
106
+ track('editor_install', {
107
+ editor,
108
+ status,
109
+ platform: process.platform,
110
+ node: process.version
111
+ });
112
+ }
113
+
114
+ /**
115
+ * Track tool usage distribution (called per tool invocation)
116
+ * @param {string} toolName - Tool name (vibe_*)
117
+ */
118
+ function trackToolUsage(toolName) {
119
+ track('tool_call', { tool: toolName });
120
+ }
121
+
100
122
  module.exports = {
101
123
  track,
102
124
  trackEmptyInbox,
103
125
  trackLurkMode,
104
126
  trackOnboardingTask,
105
127
  trackDiscovery,
106
- trackSession
128
+ trackSession,
129
+ trackInstall,
130
+ trackToolUsage
107
131
  };
package/auto-update.js CHANGED
@@ -3,14 +3,16 @@
3
3
  * Checks for updates and prompts user to update
4
4
  */
5
5
 
6
- const { exec } = require('child_process');
7
- const { promisify } = require('util');
8
- const fs = require('fs').promises;
9
- const path = require('path');
6
+ import { exec } from 'child_process';
7
+ import { promisify } from 'util';
8
+ import fs from 'fs/promises';
9
+ import path from 'path';
10
+ import { fileURLToPath } from 'url';
10
11
 
11
12
  const execAsync = promisify(exec);
13
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
12
14
 
13
- async function checkForUpdates() {
15
+ export async function checkForUpdates() {
14
16
  try {
15
17
  // Read local version
16
18
  const versionPath = path.join(__dirname, 'version.json');
@@ -45,7 +47,7 @@ async function checkForUpdates() {
45
47
  }
46
48
  }
47
49
 
48
- async function performUpdate() {
50
+ export async function performUpdate() {
49
51
  try {
50
52
  const repoPath = path.join(__dirname, '..');
51
53
 
@@ -82,7 +84,7 @@ async function performUpdate() {
82
84
  }
83
85
  }
84
86
 
85
- function compareVersions(v1, v2) {
87
+ export function compareVersions(v1, v2) {
86
88
  const parts1 = v1.split('.').map(Number);
87
89
  const parts2 = v2.split('.').map(Number);
88
90
 
@@ -94,7 +96,7 @@ function compareVersions(v1, v2) {
94
96
  return 0;
95
97
  }
96
98
 
97
- function formatUpdateNotification(update) {
99
+ export function formatUpdateNotification(update) {
98
100
  if (!update) return null;
99
101
 
100
102
  let message = `\n${'='.repeat(60)}\n`;
@@ -121,10 +123,3 @@ function formatUpdateNotification(update) {
121
123
 
122
124
  return message;
123
125
  }
124
-
125
- module.exports = {
126
- checkForUpdates,
127
- performUpdate,
128
- compareVersions,
129
- formatUpdateNotification
130
- };
package/config.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Config — User identity and paths
3
3
  *
4
- * Canonical location: ~/.vibe/config.json
5
- * Falls back to ~/.vibecodings/config.json for backward compat
4
+ * UNIFIED: Uses ~/.vibecodings/config.json as primary source
5
+ * Falls back to ~/.vibe/config.json for backward compat
6
6
  */
7
7
 
8
8
  const fs = require('fs');
@@ -10,31 +10,16 @@ const path = require('path');
10
10
 
11
11
  const VIBE_DIR = path.join(process.env.HOME, '.vibe');
12
12
  const VIBECODINGS_DIR = path.join(process.env.HOME, '.vibecodings');
13
- const PRIMARY_CONFIG = path.join(VIBE_DIR, 'config.json'); // Primary
14
- const FALLBACK_CONFIG = path.join(VIBECODINGS_DIR, 'config.json'); // Fallback
15
- const TERMINAL_AUTH_FILE = path.join(VIBE_DIR, 'auth.json'); // Cross-client (Buddy/Terminal)
13
+ const PRIMARY_CONFIG = path.join(VIBECODINGS_DIR, 'config.json'); // Primary
14
+ const FALLBACK_CONFIG = path.join(VIBE_DIR, 'config.json'); // Fallback
16
15
  const CONFIG_FILE = PRIMARY_CONFIG;
17
16
 
18
17
  function ensureDir() {
19
- if (!fs.existsSync(VIBE_DIR)) {
20
- fs.mkdirSync(VIBE_DIR, { recursive: true });
18
+ if (!fs.existsSync(VIBECODINGS_DIR)) {
19
+ fs.mkdirSync(VIBECODINGS_DIR, { recursive: true });
21
20
  }
22
21
  }
23
22
 
24
- /**
25
- * Load terminal/buddy auth file (~/.vibe/auth.json)
26
- * Cross-client: if user authenticated via Buddy app, MCP server can pick it up
27
- * Format: { token, handle, provider, authenticated_at }
28
- */
29
- function loadTerminalAuth() {
30
- try {
31
- if (fs.existsSync(TERMINAL_AUTH_FILE)) {
32
- return JSON.parse(fs.readFileSync(TERMINAL_AUTH_FILE, 'utf8'));
33
- }
34
- } catch (e) {}
35
- return null;
36
- }
37
-
38
23
  function load() {
39
24
  ensureDir();
40
25
  // Try primary config first
@@ -72,7 +57,7 @@ function save(config) {
72
57
  }
73
58
  } catch (e) {}
74
59
 
75
- // Save to primary config (~/.vibe/config.json)
60
+ // Save to primary config in vibecodings format
76
61
  const data = {
77
62
  username: config.handle || config.username || existing.username,
78
63
  workingOn: config.one_liner || config.workingOn || existing.workingOn,
@@ -85,27 +70,27 @@ function save(config) {
85
70
  // Notification level
86
71
  notifications: config.notifications || existing.notifications || null,
87
72
  // GitHub Activity settings
88
- github_activity_enabled: config.github_activity_enabled !== undefined ? config.github_activity_enabled : existing.github_activity_enabled,
73
+ github_activity_enabled:
74
+ config.github_activity_enabled !== undefined ? config.github_activity_enabled : existing.github_activity_enabled,
89
75
  github_activity_privacy: config.github_activity_privacy || existing.github_activity_privacy || null,
90
- // OAuth token (persisted across MCP process restarts)
91
- authToken: config.authToken || config.privyToken || existing.authToken || existing.privyToken || null,
76
+ // Privy OAuth token (persisted across MCP process restarts)
77
+ privyToken: config.privyToken || existing.privyToken || null,
92
78
  authMethod: config.authMethod || existing.authMethod || null
93
79
  };
94
80
  fs.writeFileSync(PRIMARY_CONFIG, JSON.stringify(data, null, 2));
95
81
  }
96
82
 
83
+ /** @returns {string|null} Current user handle */
97
84
  function getHandle() {
98
85
  // Prefer session-specific handle over shared config
99
86
  const sessionHandle = getSessionHandle();
100
87
  if (sessionHandle) return sessionHandle;
101
88
  // Fall back to shared config
102
- const cfg = load();
103
- if (cfg.handle) return cfg.handle;
104
- // Cross-client: check terminal/buddy auth file
105
- const terminalAuth = loadTerminalAuth();
106
- return terminalAuth?.handle || null;
89
+ const config = load();
90
+ return config.handle || null;
107
91
  }
108
92
 
93
+ /** @returns {string|null} Current user one-liner */
109
94
  function getOneLiner() {
110
95
  // Prefer session-specific one_liner over shared config
111
96
  const sessionOneLiner = getSessionOneLiner();
@@ -115,6 +100,7 @@ function getOneLiner() {
115
100
  return config.one_liner || null;
116
101
  }
117
102
 
103
+ /** @returns {boolean} Whether user identity is set */
118
104
  function isInitialized() {
119
105
  // Check session first, then shared config
120
106
  const sessionHandle = getSessionHandle();
@@ -125,8 +111,9 @@ function isInitialized() {
125
111
 
126
112
  // Session management - unique ID per Claude Code instance
127
113
  // Now stores full identity (handle + one_liner), not just sessionId
128
- const SESSION_FILE = path.join(VIBE_DIR, `.session_${process.pid}`);
114
+ const SESSION_FILE = path.join(VIBECODINGS_DIR, `.session_${process.pid}`);
129
115
 
116
+ /** @returns {string} New session ID (sess_*) */
130
117
  function generateSessionId() {
131
118
  return 'sess_' + Date.now().toString(36) + Math.random().toString(36).substring(2, 10);
132
119
  }
@@ -235,64 +222,43 @@ function getAuthToken() {
235
222
 
236
223
  // Fall back to shared config (persisted across MCP process restarts)
237
224
  const cfg = load();
238
- if (cfg?.authToken || cfg?.privyToken) return cfg.authToken || cfg.privyToken;
239
-
240
- // Cross-client: check terminal/buddy auth file (~/.vibe/auth.json)
241
- const terminalAuth = loadTerminalAuth();
242
- if (terminalAuth?.token) return terminalAuth.token;
243
-
244
- return null;
225
+ return cfg?.privyToken || null;
245
226
  }
246
227
 
247
228
  /**
248
- * Save auth token (used after browser OAuth flow)
249
- * @param {string} token - JWT access token from GitHub OAuth
229
+ * Save Privy JWT token (used after browser OAuth flow)
230
+ * @param {string} token - Privy access token
250
231
  */
251
- function saveAuthToken(token) {
232
+ function savePrivyToken(token) {
252
233
  // Save to session data
253
234
  const data = getSessionData() || {};
254
235
  saveSessionData({
255
236
  ...data,
256
237
  sessionId: data.sessionId || generateSessionId(),
257
238
  token,
258
- authMethod: 'github' // Track that this is GitHub OAuth
239
+ authMethod: 'privy' // Track that this is a Privy token
259
240
  });
260
241
 
261
242
  // Also save to shared config for persistence across MCP restarts
262
243
  const cfg = load();
263
- cfg.authToken = token;
264
- cfg.authMethod = 'github';
244
+ cfg.privyToken = token;
245
+ cfg.authMethod = 'privy';
265
246
  save(cfg);
266
247
  }
267
248
 
268
- // Backwards compatibility alias
269
- const savePrivyToken = saveAuthToken;
270
-
271
249
  /**
272
- * Check if user has OAuth auth (vs legacy keypair)
273
- * Accepts 'github', 'privy', and 'browser' as valid auth methods (backwards compat)
250
+ * Check if user has Privy auth (vs legacy keypair)
274
251
  */
275
- function hasOAuth() {
276
- const validAuthMethods = ['github', 'privy', 'browser'];
277
-
252
+ function hasPrivyAuth() {
278
253
  const data = getSessionData();
279
- if (validAuthMethods.includes(data?.authMethod) && data?.token) return true;
254
+ if (data?.authMethod === 'privy' && data?.token) return true;
280
255
 
281
256
  const cfg = load();
282
- if (validAuthMethods.includes(cfg?.authMethod) && (cfg?.authToken || cfg?.privyToken)) return true;
283
-
284
- // Cross-client: check terminal/buddy auth file
285
- const terminalAuth = loadTerminalAuth();
286
- if (terminalAuth?.token && validAuthMethods.includes(terminalAuth?.provider)) return true;
287
-
288
- return false;
257
+ return cfg?.authMethod === 'privy' && cfg?.privyToken;
289
258
  }
290
259
 
291
- // Backwards compatibility alias
292
- const hasPrivyAuth = hasOAuth;
293
-
294
260
  /**
295
- * Remove keypair after migration to GitHub OAuth
261
+ * Remove keypair after migration to Privy
296
262
  * Clears private key from config (security improvement)
297
263
  */
298
264
  function removeKeypair() {
@@ -398,7 +364,7 @@ function setGithubActivityPrivacy(level) {
398
364
  save(config);
399
365
  }
400
366
 
401
- // API URL central endpoint for all API calls
367
+ /** @returns {string} API base URL */
402
368
  function getApiUrl() {
403
369
  return process.env.VIBE_API_URL || 'https://www.slashvibe.dev';
404
370
  }
@@ -410,10 +376,22 @@ function getApiUrl() {
410
376
  // ─────────────────────────────────────────────────────────────
411
377
  const sessionState = {};
412
378
 
379
+ /**
380
+ * Get ephemeral session state value
381
+ * @param {string} key - State key
382
+ * @param {*} [defaultValue=null] - Default if not set
383
+ * @returns {*} Stored value or default
384
+ */
413
385
  function get(key, defaultValue = null) {
414
386
  return sessionState[key] !== undefined ? sessionState[key] : defaultValue;
415
387
  }
416
388
 
389
+ /**
390
+ * Set ephemeral session state value
391
+ * @param {string} key - State key
392
+ * @param {*} value - Value to store
393
+ * @returns {*} The stored value
394
+ */
417
395
  function set(key, value) {
418
396
  sessionState[key] = value;
419
397
  return value;
@@ -424,7 +402,6 @@ module.exports = {
424
402
  CONFIG_FILE,
425
403
  load,
426
404
  save,
427
- loadTerminalAuth,
428
405
  getHandle,
429
406
  getOneLiner,
430
407
  isInitialized,
@@ -449,10 +426,7 @@ module.exports = {
449
426
  getGithubActivityPrivacy,
450
427
  setGithubActivityPrivacy,
451
428
  getApiUrl,
452
- // OAuth helpers
453
- saveAuthToken,
454
- hasOAuth,
455
- // Backwards compatibility aliases
429
+ // Privy OAuth helpers
456
430
  savePrivyToken,
457
431
  hasPrivyAuth,
458
432
  removeKeypair,
package/crypto.js CHANGED
@@ -106,12 +106,7 @@ function verify(obj, publicKeyBase64) {
106
106
  });
107
107
 
108
108
  // Verify
109
- return crypto.verify(
110
- null,
111
- Buffer.from(canonical, 'utf8'),
112
- publicKey,
113
- Buffer.from(signature, 'base64')
114
- );
109
+ return crypto.verify(null, Buffer.from(canonical, 'utf8'), publicKey, Buffer.from(signature, 'base64'));
115
110
  } catch (e) {
116
111
  console.error('[crypto] Verification failed:', e.message);
117
112
  return false;
package/debug.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Debug logging — conditional on VIBE_DEBUG env var
3
+ *
4
+ * @param {...*} args Arguments to log
5
+ */
6
+ function debug(...args) {
7
+ if (process.env.VIBE_DEBUG === 'true') {
8
+ console.error(...args);
9
+ }
10
+ }
11
+
12
+ module.exports = debug;