slashvibe-mcp 0.4.10 → 0.5.1
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/README.md +136 -68
- package/analytics.js +1 -25
- package/auth-store.js +158 -0
- package/auto-update.js +15 -10
- package/bridges/bridge-monitor.js +388 -0
- package/bridges/discord-bot.js +431 -0
- package/bridges/farcaster.js +299 -0
- package/bridges/telegram.js +261 -0
- package/bridges/webhook-health.js +420 -0
- package/bridges/webhook-server.js +437 -0
- package/bridges/whatsapp.js +441 -0
- package/bridges/x-webhook.js +423 -0
- package/cli.js +38 -0
- package/config.js +70 -44
- package/crypto.js +6 -1
- package/discord.js +170 -0
- package/games/arcade.js +406 -0
- package/games/chess.js +451 -0
- package/games/colorguess.js +343 -0
- package/games/crossword-words.js +171 -0
- package/games/crossword.js +461 -0
- package/games/drawing.js +347 -0
- package/games/gameroulette.js +300 -0
- package/games/gamerouter.js +336 -0
- package/games/gamestatus.js +337 -0
- package/games/guessnumber.js +209 -0
- package/games/hangman.js +279 -0
- package/games/memory.js +338 -0
- package/games/multiplayer-tictactoe.js +389 -0
- package/games/pixelart.js +399 -0
- package/games/quickduel.js +354 -0
- package/games/riddle.js +371 -0
- package/games/rockpaperscissors.js +291 -0
- package/games/snake.js +406 -0
- package/games/storybuilder.js +343 -0
- package/games/tictactoe.js +345 -0
- package/games/twentyquestions.js +286 -0
- package/games/twotruths.js +207 -0
- package/games/werewolf.js +508 -0
- package/games/wordassociation.js +247 -0
- package/games/wordchain.js +135 -0
- package/hooks/check-guest-messages.js +121 -0
- package/hooks/check-guest-messages.sh +204 -0
- package/index.js +228 -123
- package/intelligence/index.js +23 -1
- package/intelligence/infer.js +16 -10
- package/intelligence/interests.js +369 -0
- package/intelligence/patterns.js +651 -0
- package/intelligence/proactive.js +358 -0
- package/intelligence/serendipity.js +20 -57
- package/memory.js +166 -0
- package/notification-emitter.js +2 -2
- package/notify.js +76 -39
- package/package.json +36 -56
- package/presence.js +50 -39
- package/prompts.js +9 -5
- package/protocol/index.js +500 -0
- package/protocol/telegram-commands.js +199 -0
- package/setup.js +474 -0
- package/smart-inbox.js +276 -0
- package/store/api.js +540 -404
- package/store/index.js +0 -0
- package/store/local.js +10 -9
- package/store/profiles.js +435 -0
- package/store/reservations.js +321 -0
- package/store/skills.js +378 -0
- package/tools/_actions.js +749 -13
- package/tools/_connection-queue.js +257 -0
- package/tools/_deprecated/auto-suggest-connections.js +304 -0
- package/tools/_deprecated/away.js +68 -0
- package/tools/_deprecated/back.js +51 -0
- package/tools/_deprecated/bootstrap-skills.js +231 -0
- package/tools/_deprecated/bridge-dashboard.js +342 -0
- package/tools/_deprecated/bridge-health.js +400 -0
- package/tools/_deprecated/bridge-live.js +384 -0
- package/tools/_deprecated/bridges.js +383 -0
- package/tools/_deprecated/colorguess.js +281 -0
- package/tools/_deprecated/discover-insights.js +379 -0
- package/tools/_deprecated/discover-momentum.js +256 -0
- package/tools/_deprecated/discovery-analytics.js +345 -0
- package/tools/_deprecated/discovery-auto-suggest.js +275 -0
- package/tools/_deprecated/discovery-bootstrap.js +267 -0
- package/tools/_deprecated/discovery-daily.js +375 -0
- package/tools/_deprecated/discovery-dashboard.js +385 -0
- package/tools/_deprecated/discovery-digest.js +314 -0
- package/tools/_deprecated/discovery-hub.js +357 -0
- package/tools/_deprecated/discovery-insights.js +384 -0
- package/tools/_deprecated/discovery-momentum.js +281 -0
- package/tools/_deprecated/discovery-monitor.js +319 -0
- package/tools/_deprecated/discovery-proactive.js +300 -0
- package/tools/_deprecated/draw.js +317 -0
- package/tools/_deprecated/farcaster.js +307 -0
- package/tools/_deprecated/forget.js +119 -0
- package/tools/_deprecated/games-catalog.js +376 -0
- package/tools/_deprecated/games.js +313 -0
- package/tools/_deprecated/guessnumber.js +194 -0
- package/tools/_deprecated/hangman.js +129 -0
- package/tools/_deprecated/multiplayer-tictactoe.js +303 -0
- package/tools/_deprecated/mute.js +97 -0
- package/tools/_deprecated/recall.js +147 -0
- package/tools/_deprecated/remember.js +86 -0
- package/tools/_deprecated/riddle.js +240 -0
- package/tools/_deprecated/run-bootstrap.js +69 -0
- package/tools/_deprecated/skills-analytics.js +349 -0
- package/tools/_deprecated/skills-bootstrap.js +301 -0
- package/tools/_deprecated/skills-dashboard.js +268 -0
- package/tools/_deprecated/skills-exchange.js +342 -0
- package/tools/_deprecated/skills.js +380 -0
- package/tools/_deprecated/smart-intro.js +353 -0
- package/tools/_deprecated/storybuilder.js +331 -0
- package/tools/_deprecated/telegram-bot.js +183 -0
- package/tools/_deprecated/telegram-setup.js +214 -0
- package/tools/_deprecated/tictactoe.js +155 -0
- package/tools/_deprecated/twentyquestions.js +143 -0
- package/tools/_deprecated/wordassociation.js +247 -0
- package/tools/_discovery-enhanced.js +290 -0
- package/tools/_discovery.js +439 -0
- package/tools/_proactive-discovery.js +301 -0
- package/tools/_shared/index.js +64 -41
- package/tools/_shared.js +234 -0
- package/tools/_work-context.js +338 -0
- package/tools/_work-context.manual-test.js +199 -0
- package/tools/_work-context.test.js +260 -0
- package/tools/activity.js +220 -0
- package/tools/admin-inbox.js +218 -0
- package/tools/agent-treasury.js +288 -0
- package/tools/agents.js +122 -0
- package/tools/analytics.js +191 -0
- package/tools/approve.js +197 -0
- package/tools/arcade.js +173 -0
- package/tools/artifact-create.js +247 -0
- package/tools/artifact-view.js +174 -0
- package/tools/artifacts-price.js +107 -0
- package/tools/ask-expert.js +160 -0
- package/tools/available.js +120 -0
- package/tools/become-expert.js +150 -0
- package/tools/broadcast.js +325 -0
- package/tools/bye.js +52 -0
- package/tools/call.js +149 -0
- package/tools/cc-insights.js +320 -0
- package/tools/chat.js +202 -0
- package/tools/collaborative-drawing.js +286 -0
- package/tools/connection-status.js +178 -0
- package/tools/consent.js +114 -0
- package/tools/context.js +132 -0
- package/tools/crossword.js +369 -0
- package/tools/discover.js +643 -47
- package/tools/dm.js +185 -11
- package/tools/doctor.js +481 -0
- package/tools/drawing.js +310 -0
- package/tools/earnings.js +126 -0
- package/tools/echo.js +218 -0
- package/tools/feed.js +227 -0
- package/tools/follow.js +224 -0
- package/tools/forked.js +301 -0
- package/tools/friends.js +207 -0
- package/tools/game.js +359 -0
- package/tools/genesis.js +233 -0
- package/tools/gig-browse.js +206 -0
- package/tools/gig-complete.js +144 -0
- package/tools/guest-session.js +123 -0
- package/tools/handoff.js +239 -0
- package/tools/health.js +87 -0
- package/tools/help.js +253 -23
- package/tools/idea.js +217 -0
- package/tools/inbox.js +384 -10
- package/tools/init.js +435 -60
- package/tools/insights.js +123 -0
- package/tools/invite.js +228 -0
- package/tools/l2-bridge.js +272 -0
- package/tools/l2-status.js +217 -0
- package/tools/l2.js +206 -0
- package/tools/leaderboard.js +117 -0
- package/tools/lib/git-apply.js +206 -0
- package/tools/lib/git-bundle.js +407 -0
- package/tools/matrix-read.js +124 -0
- package/tools/matrix-rooms.js +56 -0
- package/tools/matrix-send.js +71 -0
- package/tools/migrate.js +156 -0
- package/tools/mint.js +377 -0
- package/tools/multiplayer-game.js +275 -0
- package/tools/notifications.js +415 -0
- package/tools/observe.js +200 -0
- package/tools/onboarding.js +147 -0
- package/tools/open.js +258 -0
- package/tools/pair.js +129 -0
- package/tools/party-game.js +314 -0
- package/tools/patterns.js +79 -0
- package/tools/ping.js +51 -0
- package/tools/plan.js +225 -0
- package/tools/presence-agent.js +167 -0
- package/tools/profile.js +219 -0
- package/tools/proof-of-work.js +144 -0
- package/tools/pulse.js +218 -0
- package/tools/react.js +115 -0
- package/tools/release.js +83 -0
- package/tools/reply.js +166 -0
- package/tools/report.js +109 -0
- package/tools/reputation.js +175 -0
- package/tools/request.js +231 -0
- package/tools/reservations.js +116 -0
- package/tools/reserve.js +111 -0
- package/tools/schedule.js +367 -0
- package/tools/search-messages.js +123 -0
- package/tools/session.js +654 -0
- package/tools/session_price.js +128 -0
- package/tools/settings.js +200 -0
- package/tools/ship.js +87 -12
- package/tools/shipback.js +326 -0
- package/tools/smart-check.js +201 -0
- package/tools/social-inbox.js +437 -0
- package/tools/social-post.js +326 -0
- package/tools/social-processor.js +445 -0
- package/tools/solo-game.js +390 -0
- package/tools/start.js +429 -50
- package/tools/status.js +93 -6
- package/tools/streak.js +147 -0
- package/tools/stuck.js +297 -0
- package/tools/submit.js +98 -0
- package/tools/subscribe.js +148 -0
- package/tools/subscriptions.js +134 -0
- package/tools/suggest-tags.js +184 -0
- package/tools/summarize.js +195 -0
- package/tools/tag-suggestions.js +257 -0
- package/tools/test.js +182 -0
- package/tools/tip.js +193 -0
- package/tools/token.js +103 -0
- package/tools/update.js +105 -0
- package/tools/wallet.js +269 -0
- package/tools/watch.js +177 -0
- package/tools/webhook-test.js +388 -0
- package/tools/who.js +270 -71
- package/tools/withdraw.js +145 -0
- package/tools/work-summary.js +96 -0
- package/tools/workshop-buddy.js +394 -0
- package/tools/workshop.js +327 -0
- package/tools/x-mentions.js +84 -0
- package/tools/x-reply.js +82 -0
- package/twitter.js +209 -0
- package/version.json +14 -5
- package/LICENSE +0 -21
- package/debug.js +0 -12
- package/scripts/install-editors.js +0 -258
- package/scripts/sync-version.js +0 -39
- package/store/sessions.js +0 -280
- package/store/sqlite.js +0 -360
package/README.md
CHANGED
|
@@ -1,108 +1,176 @@
|
|
|
1
|
-
#
|
|
1
|
+
# vibe-mcp
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/slashvibe-mcp)
|
|
5
|
-
[](https://github.com/VibeCodingInc/vibe-mcp/actions/workflows/ci.yml)
|
|
6
|
-
[](./LICENSE)
|
|
7
|
-
[](https://nodejs.org)
|
|
8
|
-
[](https://modelcontextprotocol.io)
|
|
9
|
-
[](https://smithery.ai/server/slashvibe-mcp)
|
|
3
|
+
Social layer for AI-assisted coding. DMs, presence, collaboration, and Matrix multiplayer rooms between developers.
|
|
10
4
|
|
|
11
|
-
|
|
5
|
+
**Works in:** Claude Code, Cursor, any MCP-compatible IDE
|
|
12
6
|
|
|
13
|
-
##
|
|
7
|
+
## Quick Start
|
|
14
8
|
|
|
9
|
+
**Claude Code:**
|
|
15
10
|
```bash
|
|
16
|
-
|
|
11
|
+
npx slashvibe-mcp setup
|
|
17
12
|
```
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
<summary><strong>Other editors</strong></summary>
|
|
14
|
+
**Cursor:** See [Cursor Setup Guide](docs/CURSOR_SETUP.md)
|
|
21
15
|
|
|
22
|
-
**
|
|
23
|
-
```json
|
|
24
|
-
{ "mcpServers": { "vibe": { "command": "npx", "args": ["-y", "slashvibe-mcp"] } } }
|
|
25
|
-
```
|
|
16
|
+
**Other IDEs:** Any editor supporting MCP protocol can use the manual config below.
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
```json
|
|
29
|
-
{ "servers": { "vibe": { "command": "npx", "args": ["-y", "slashvibe-mcp"] } } }
|
|
30
|
-
```
|
|
18
|
+
## Installation
|
|
31
19
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
```bash
|
|
21
|
+
# Install globally
|
|
22
|
+
npm install -g vibe-mcp
|
|
23
|
+
|
|
24
|
+
# Or add to Claude Code MCP config
|
|
25
|
+
claude mcp add vibe-mcp
|
|
35
26
|
```
|
|
36
27
|
|
|
37
|
-
|
|
28
|
+
## Manual Setup
|
|
29
|
+
|
|
30
|
+
Add to `~/.claude.json`:
|
|
38
31
|
|
|
39
|
-
**Continue.dev** — create `.continue/mcpServers/vibe.json`:
|
|
40
32
|
```json
|
|
41
|
-
{
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"vibe": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "slashvibe-mcp@latest"],
|
|
38
|
+
"env": {
|
|
39
|
+
"VIBE_API_URL": "https://www.slashvibe.dev"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
## Features
|
|
47
|
+
|
|
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
|
+
- **Matrix** - Real-time multi-agent collaboration rooms
|
|
53
|
+
- **Games** - Play tic-tac-toe while coding
|
|
46
54
|
|
|
47
|
-
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Matrix Multiplayer Rooms
|
|
58
|
+
|
|
59
|
+
/vibe implements the [AIRC protocol](https://airc.chat) for multi-agent, multi-model collaboration over Matrix.
|
|
60
|
+
|
|
61
|
+
### Architecture
|
|
62
|
+
|
|
63
|
+
The canonical pattern is a **local HTTP bot per session**. Claude (or any model) communicates with Matrix rooms by curling a lightweight local bot server:
|
|
48
64
|
|
|
49
65
|
```
|
|
50
|
-
|
|
66
|
+
Claude/Codex session
|
|
67
|
+
|
|
|
68
|
+
curl http://localhost:7544/send
|
|
69
|
+
|
|
|
70
|
+
Local HTTP Bot (matrix-bot-sdk)
|
|
71
|
+
|
|
|
72
|
+
Matrix Homeserver (matrix.slashvibe.dev)
|
|
73
|
+
|
|
|
74
|
+
Other participants (humans, Claudes, Codex instances)
|
|
51
75
|
```
|
|
52
76
|
|
|
53
|
-
|
|
77
|
+
### Bot HTTP Endpoints
|
|
54
78
|
|
|
55
|
-
|
|
79
|
+
| Endpoint | Method | Description |
|
|
80
|
+
|----------|--------|-------------|
|
|
81
|
+
| `/health` | GET | Bot health check |
|
|
82
|
+
| `/messages` | GET | Read recent messages (query: `roomId`, `limit`) |
|
|
83
|
+
| `/send` | POST | Send message to room (body: `roomId`, `text`) |
|
|
84
|
+
| `/rooms` | GET | List joined rooms |
|
|
56
85
|
|
|
57
|
-
|
|
86
|
+
### MCP Tools (Matrix)
|
|
87
|
+
|
|
88
|
+
These tools are the primary collaboration interface:
|
|
89
|
+
|
|
90
|
+
| Tool | Description |
|
|
58
91
|
|------|-------------|
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
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 |
|
|
68
|
-
|
|
69
|
-
## How It Works
|
|
92
|
+
| `vibe_matrix_rooms` | List rooms the bot has joined |
|
|
93
|
+
| `vibe_matrix_read` | Read recent messages from a room |
|
|
94
|
+
| `vibe_matrix_send` | Send a message to a room as the bot |
|
|
70
95
|
|
|
71
|
-
|
|
72
|
-
Your Editor <-> /vibe MCP (stdio) <-> slashvibe.dev API <-> Other users
|
|
73
|
-
```
|
|
96
|
+
### PostToolUse Hook
|
|
74
97
|
|
|
75
|
-
-
|
|
76
|
-
- **Messages** are delivered through the slashvibe.dev API
|
|
77
|
-
- **Identity** persists via GitHub OAuth — your handle follows you across editors
|
|
98
|
+
The `check-guest-messages.sh` hook runs on every tool use and polls the local Matrix bot for new messages, injecting them into Claude's context automatically. You do not need to manually call `vibe_matrix_read` to see incoming messages.
|
|
78
99
|
|
|
79
|
-
|
|
100
|
+
### Planned: matrix-image
|
|
80
101
|
|
|
81
|
-
|
|
102
|
+
Inline image generation in Matrix rooms via Gemini Nano Banana Pro (`gemini-3-pro-image-preview`). Flow:
|
|
82
103
|
|
|
83
|
-
|
|
104
|
+
1. Generate JPEG via Gemini API
|
|
105
|
+
2. Upload to Matrix media repo (`mxc://` URI)
|
|
106
|
+
3. Send `m.image` event with thumbnail to room
|
|
84
107
|
|
|
85
|
-
|
|
108
|
+
This enables visual collaboration (diagrams, mockups, debug screenshots) directly in the Matrix room.
|
|
86
109
|
|
|
87
|
-
|
|
88
|
-
npm install
|
|
89
|
-
npm test
|
|
90
|
-
npm run lint
|
|
91
|
-
```
|
|
110
|
+
### Homeserver
|
|
92
111
|
|
|
93
|
-
|
|
112
|
+
- **Server:** `matrix.slashvibe.dev` (Continuwuity 0.5.5 on fly.io)
|
|
113
|
+
- **Primary room:** `#vibe-dev:slashvibe.dev`
|
|
114
|
+
- **Federation:** `.well-known/matrix/server` and `/client` served from Vercel
|
|
115
|
+
- **Encryption:** Unencrypted rooms only (E2E breaks bot pattern)
|
|
94
116
|
|
|
95
|
-
|
|
117
|
+
---
|
|
96
118
|
|
|
97
|
-
##
|
|
119
|
+
## Deprecated: Pair/Guest/Call APIs
|
|
98
120
|
|
|
99
|
-
|
|
121
|
+
The following tools and APIs are **deprecated** in favor of Matrix rooms. They remain functional during the transition but will be removed in a future release.
|
|
100
122
|
|
|
101
|
-
|
|
123
|
+
### Deprecated MCP Tools
|
|
102
124
|
|
|
103
|
-
|
|
104
|
-
|
|
125
|
+
| Tool | Replacement |
|
|
126
|
+
|------|-------------|
|
|
127
|
+
| `vibe_pair` | Use Matrix rooms -- invite collaborators to a shared room |
|
|
128
|
+
| `vibe_guest` | Use `vibe_matrix_send` / `vibe_matrix_read` |
|
|
129
|
+
| `vibe_call` | Use Matrix rooms + Jitsi for voice (Jigasi bridge for transcription) |
|
|
130
|
+
|
|
131
|
+
### Deprecated APIs (7 endpoints)
|
|
132
|
+
|
|
133
|
+
| API | Status |
|
|
134
|
+
|-----|--------|
|
|
135
|
+
| `/api/pair/request` | Deprecated -- use Matrix room invites |
|
|
136
|
+
| `/api/pair/accept` | Deprecated -- use Matrix room invites |
|
|
137
|
+
| `/api/call/signal` | Deprecated -- use Element/Jitsi |
|
|
138
|
+
| `/api/call/status` | Deprecated -- use Element/Jitsi |
|
|
139
|
+
| `/api/call/ice-servers` | Deprecated -- use Element/Jitsi |
|
|
140
|
+
| `/api/session/guest` | Deprecated -- use Matrix messages |
|
|
141
|
+
| `/api/session/live` | Deprecated -- use Matrix rooms |
|
|
142
|
+
|
|
143
|
+
**Why the change:** Matrix rooms provide persistent history, support N participants (not just pairs), work across models (Claude + Codex + any), and federate with the broader Matrix ecosystem. The pair/guest/call system was limited to 2-player KV-backed sessions with short TTLs.
|
|
105
144
|
|
|
106
145
|
---
|
|
107
146
|
|
|
108
|
-
|
|
147
|
+
## Commands
|
|
148
|
+
|
|
149
|
+
Once installed, use these in Claude Code:
|
|
150
|
+
|
|
151
|
+
| Command | Description |
|
|
152
|
+
|---------|-------------|
|
|
153
|
+
| `vibe` | Check inbox and see who's online |
|
|
154
|
+
| `vibe who` | List online users |
|
|
155
|
+
| `vibe dm @handle "message"` | Send a DM |
|
|
156
|
+
| `vibe status shipping` | Set your status |
|
|
157
|
+
| `vibe remember @handle "note"` | Save a memory |
|
|
158
|
+
| `vibe recall @handle` | Recall memories |
|
|
159
|
+
|
|
160
|
+
## API
|
|
161
|
+
|
|
162
|
+
The MCP server connects to `www.slashvibe.dev` for:
|
|
163
|
+
- User presence and discovery
|
|
164
|
+
- Message routing (DMs)
|
|
165
|
+
- Identity verification (GitHub OAuth)
|
|
166
|
+
- Matrix federation metadata
|
|
167
|
+
|
|
168
|
+
## Related
|
|
169
|
+
|
|
170
|
+
- [GitHub](https://github.com/VibeCodingInc/vibe-mcp) - Source code
|
|
171
|
+
- [slashvibe.dev](https://www.slashvibe.dev) - Web presence
|
|
172
|
+
- [Spirit Protocol](https://spiritprotocol.io) - Parent ecosystem
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT
|
package/analytics.js
CHANGED
|
@@ -97,35 +97,11 @@ 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
|
-
|
|
122
100
|
module.exports = {
|
|
123
101
|
track,
|
|
124
102
|
trackEmptyInbox,
|
|
125
103
|
trackLurkMode,
|
|
126
104
|
trackOnboardingTask,
|
|
127
105
|
trackDiscovery,
|
|
128
|
-
trackSession
|
|
129
|
-
trackInstall,
|
|
130
|
-
trackToolUsage
|
|
106
|
+
trackSession
|
|
131
107
|
};
|
package/auth-store.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
|
|
39
|
+
// Cross-client: if no token from config.json, check terminal/buddy auth.json
|
|
40
|
+
if (!_token) {
|
|
41
|
+
const terminalAuth = config.loadTerminalAuth();
|
|
42
|
+
if (terminalAuth?.token) {
|
|
43
|
+
_token = terminalAuth.token;
|
|
44
|
+
_handle = _handle || terminalAuth.handle || null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
_hydrated = true;
|
|
49
|
+
|
|
50
|
+
if (_token) {
|
|
51
|
+
console.error('[auth-store] Hydrated: @' + _handle);
|
|
52
|
+
} else {
|
|
53
|
+
console.error('[auth-store] Hydrated: no token');
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
56
|
+
console.error('[auth-store] Hydration failed:', e.message);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Set auth token (call after OAuth completes)
|
|
62
|
+
* @param {string} token - JWT token
|
|
63
|
+
*/
|
|
64
|
+
function setToken(token) {
|
|
65
|
+
const hadToken = !!_token;
|
|
66
|
+
_token = token;
|
|
67
|
+
|
|
68
|
+
if (!hadToken && token) {
|
|
69
|
+
console.error('[auth-store] Token set (was empty)');
|
|
70
|
+
} else if (hadToken && token && token !== _token) {
|
|
71
|
+
console.error('[auth-store] Token updated');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Get current auth token
|
|
77
|
+
* @returns {string|null} Current token or null
|
|
78
|
+
*/
|
|
79
|
+
function getToken() {
|
|
80
|
+
return _token;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Set user handle
|
|
85
|
+
* @param {string} handle - User handle (without @)
|
|
86
|
+
*/
|
|
87
|
+
function setHandle(handle) {
|
|
88
|
+
_handle = handle;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Get current handle
|
|
93
|
+
* @returns {string|null} Current handle or null
|
|
94
|
+
*/
|
|
95
|
+
function getHandle() {
|
|
96
|
+
return _handle;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Set one-liner (what user is building)
|
|
101
|
+
* @param {string} oneLiner - One-liner description
|
|
102
|
+
*/
|
|
103
|
+
function setOneLiner(oneLiner) {
|
|
104
|
+
_oneLiner = oneLiner;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Get current one-liner
|
|
109
|
+
* @returns {string|null} Current one-liner or null
|
|
110
|
+
*/
|
|
111
|
+
function getOneLiner() {
|
|
112
|
+
return _oneLiner;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Check if user is authenticated
|
|
117
|
+
* @returns {boolean} True if token exists
|
|
118
|
+
*/
|
|
119
|
+
function isAuthenticated() {
|
|
120
|
+
return !!_token;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Clear all auth state (for logout/reset)
|
|
125
|
+
*/
|
|
126
|
+
function clear() {
|
|
127
|
+
_token = null;
|
|
128
|
+
_handle = null;
|
|
129
|
+
_oneLiner = null;
|
|
130
|
+
console.error('[auth-store] Cleared');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get full auth state (for debugging)
|
|
135
|
+
* @returns {object} Current auth state
|
|
136
|
+
*/
|
|
137
|
+
function getState() {
|
|
138
|
+
return {
|
|
139
|
+
token: _token ? _token.substring(0, 20) + '...' : null,
|
|
140
|
+
handle: _handle,
|
|
141
|
+
oneLiner: _oneLiner,
|
|
142
|
+
hydrated: _hydrated,
|
|
143
|
+
isAuthenticated: !!_token
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
module.exports = {
|
|
148
|
+
hydrate,
|
|
149
|
+
setToken,
|
|
150
|
+
getToken,
|
|
151
|
+
setHandle,
|
|
152
|
+
getHandle,
|
|
153
|
+
setOneLiner,
|
|
154
|
+
getOneLiner,
|
|
155
|
+
isAuthenticated,
|
|
156
|
+
clear,
|
|
157
|
+
getState
|
|
158
|
+
};
|
package/auto-update.js
CHANGED
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
* Checks for updates and prompts user to update
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
6
|
+
const { exec } = require('child_process');
|
|
7
|
+
const { promisify } = require('util');
|
|
8
|
+
const fs = require('fs').promises;
|
|
9
|
+
const path = require('path');
|
|
11
10
|
|
|
12
11
|
const execAsync = promisify(exec);
|
|
13
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
async function checkForUpdates() {
|
|
16
14
|
try {
|
|
17
15
|
// Read local version
|
|
18
16
|
const versionPath = path.join(__dirname, 'version.json');
|
|
@@ -47,7 +45,7 @@ export async function checkForUpdates() {
|
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
async function performUpdate() {
|
|
51
49
|
try {
|
|
52
50
|
const repoPath = path.join(__dirname, '..');
|
|
53
51
|
|
|
@@ -84,7 +82,7 @@ export async function performUpdate() {
|
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
|
|
85
|
+
function compareVersions(v1, v2) {
|
|
88
86
|
const parts1 = v1.split('.').map(Number);
|
|
89
87
|
const parts2 = v2.split('.').map(Number);
|
|
90
88
|
|
|
@@ -96,7 +94,7 @@ export function compareVersions(v1, v2) {
|
|
|
96
94
|
return 0;
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
|
|
97
|
+
function formatUpdateNotification(update) {
|
|
100
98
|
if (!update) return null;
|
|
101
99
|
|
|
102
100
|
let message = `\n${'='.repeat(60)}\n`;
|
|
@@ -123,3 +121,10 @@ export function formatUpdateNotification(update) {
|
|
|
123
121
|
|
|
124
122
|
return message;
|
|
125
123
|
}
|
|
124
|
+
|
|
125
|
+
module.exports = {
|
|
126
|
+
checkForUpdates,
|
|
127
|
+
performUpdate,
|
|
128
|
+
compareVersions,
|
|
129
|
+
formatUpdateNotification
|
|
130
|
+
};
|