slashvibe-mcp 0.5.0 → 0.5.2

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/auto-update.js CHANGED
@@ -6,10 +6,25 @@
6
6
  const { exec } = require('child_process');
7
7
  const { promisify } = require('util');
8
8
  const fs = require('fs').promises;
9
+ const fsSync = require('fs');
9
10
  const path = require('path');
10
11
 
11
12
  const execAsync = promisify(exec);
12
13
 
14
+ /**
15
+ * How was this copy of /vibe installed?
16
+ * - 'git' → a dev checkout / git-based install (the repo has a .git dir one level up)
17
+ * - 'npm' → installed via `npx` or a global `npm i -g` (the common case; no .git)
18
+ * The published npm package ships only the mcp-server/ directory, so the absence of
19
+ * a .git at the package root reliably means an npx/global install.
20
+ */
21
+ function detectInstallType() {
22
+ try {
23
+ if (fsSync.existsSync(path.join(__dirname, '..', '.git'))) return 'git';
24
+ } catch {}
25
+ return 'npm';
26
+ }
27
+
13
28
  async function checkForUpdates() {
14
29
  try {
15
30
  // Read local version
@@ -112,11 +127,23 @@ function formatUpdateNotification(update) {
112
127
  message += `\n`;
113
128
  }
114
129
 
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`;
130
+ // Install-type-aware guidance. The npx/global path is the one that bites people:
131
+ // `npx slashvibe-mcp` silently prefers an existing GLOBAL install over fetching
132
+ // the latest, so a stale global keeps running old (sometimes broken) code. The fix
133
+ // is to remove the global so npx resolves fresh — NOT a git pull.
134
+ if (detectInstallType() === 'git') {
135
+ message += `Update now:\n`;
136
+ message += ` vibe update\n`;
137
+ message += `\n`;
138
+ message += `Or manually:\n`;
139
+ message += ` cd ~/.vibe/vibe-repo && git pull origin main\n`;
140
+ } else {
141
+ message += `You're on an npx/global install. To get the latest:\n\n`;
142
+ message += ` npm rm -g slashvibe-mcp # clear any stale global that shadows npx\n`;
143
+ message += ` # then restart Claude Code (npx will fetch the latest automatically)\n\n`;
144
+ message += `Heads up: \`npx slashvibe-mcp\` reuses an existing global if present,\n`;
145
+ message += `so removing the global is what actually pulls the new version.\n`;
146
+ }
120
147
  message += `${'='.repeat(60)}\n`;
121
148
 
122
149
  return message;
@@ -126,5 +153,6 @@ module.exports = {
126
153
  checkForUpdates,
127
154
  performUpdate,
128
155
  compareVersions,
129
- formatUpdateNotification
156
+ formatUpdateNotification,
157
+ detectInstallType
130
158
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slashvibe-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "mcpName": "io.github.vibecodinginc/vibe",
5
5
  "description": "Social layer for Claude Code - DMs, presence, Matrix multiplayer rooms, and connection between AI-assisted developers",
6
6
  "main": "index.js",
package/store/api.js CHANGED
@@ -463,10 +463,19 @@ async function sendMessage(from, to, body, type = 'dm', payload = null, options
463
463
  return { error: 'auth_failed', message: 'Authentication failed. Try `vibe init` to re-register.' };
464
464
  }
465
465
 
466
- // Handle expired token
466
+ // Handle 401 — distinguish "never signed in" from "session expired".
467
+ // Sending a DM requires GitHub OAuth; reads (presence/inbox) are open.
468
+ // A misleading "expired" message here is a first-session papercut for the pilot.
467
469
  if (result.statusCode === 401) {
468
- console.error('[vibe] Auth expired. Run browser auth to refresh token.');
469
- return { error: 'auth_expired', message: 'Auth expired. Run `vibe init` to refresh token.' };
470
+ if (!config.hasOAuth()) {
471
+ console.error('[vibe] DM requires sign-in. Run `vibe init` (GitHub OAuth).');
472
+ return {
473
+ error: 'not_signed_in',
474
+ message: "You're not signed in yet — sending a DM needs a /vibe identity. Run `vibe init` to sign in with GitHub (opens a browser, no input needed), then try again.",
475
+ };
476
+ }
477
+ console.error('[vibe] Auth expired. Run `vibe init` to reconnect.');
478
+ return { error: 'auth_expired', message: 'Your /vibe session expired. Run `vibe init` to reconnect.' };
470
479
  }
471
480
 
472
481
  // Handle storage errors (KV write failed)
package/tools/update.js CHANGED
@@ -44,14 +44,16 @@ async function handler(args) {
44
44
  const isGitInstall = fs.existsSync(gitDir);
45
45
 
46
46
  if (!isGitInstall) {
47
- // Old-style install (curl downloads)
48
- display += `⚠️ **Manual update required**\n\n`;
49
- display += `Your install doesn't support automatic updates.\n\n`;
50
- display += `To update, re-run the installer:\n`;
47
+ // npx / global install (the common case). npx prefers a stale global over
48
+ // fetching latest, so removing the global is what actually pulls the update.
49
+ display += `You're on an **npx/global install**.\n\n`;
50
+ display += `To get the latest:\n`;
51
51
  display += `\`\`\`\n`;
52
- display += `curl -fsSL https://raw.githubusercontent.com/VibeCodingInc/vibe-mcp/main/install.sh | bash\n`;
53
- display += `\`\`\`\n\n`;
54
- display += `This will migrate you to the git-based installer for future updates.\n\n`;
52
+ display += `npm rm -g slashvibe-mcp\n`;
53
+ display += `\`\`\`\n`;
54
+ display += `Then **restart Claude Code** npx will fetch the latest automatically.\n\n`;
55
+ display += `> Heads up: \`npx slashvibe-mcp\` reuses an existing global if one is\n`;
56
+ display += `> installed, so clearing the global is what pulls the new version.\n\n`;
55
57
  display += `---\n`;
56
58
  display += `⚠️ **After updating: restart Claude Code**`;
57
59
  return { display };
package/version.json CHANGED
@@ -1,15 +1,14 @@
1
1
  {
2
- "version": "0.5.0",
3
- "updated": "2026-02-19",
4
- "changelog": "Matrix multiplayer rooms: tools promoted to first-class, pair/guest/call deprecated",
2
+ "version": "0.5.2",
3
+ "updated": "2026-06-27",
4
+ "changelog": "Boot-time version guard with install-aware update guidance. If you're stuck on an old version: npx prefers a stale GLOBAL install over fetching latest — run `npm rm -g slashvibe-mcp`, then restart Claude Code.",
5
5
  "features": [
6
+ "Update notice now detects npx/global vs git installs and prints the correct fix",
7
+ "npx/global users told to `npm rm -g slashvibe-mcp` + restart (the real footgun fix)",
8
+ "First-contact DM 401 distinguishes never-signed-in from expired session",
6
9
  "Matrix multiplayer rooms",
7
10
  "Matrix tools promoted: vibe_matrix_rooms, vibe_matrix_read, vibe_matrix_send",
8
- "Configurable bot port via MATRIX_BOT_PORT env var",
9
- "PostToolUse hook polls Matrix bot for ambient message injection",
10
- "Multi-agent collaboration: Claude + Codex + any model in shared rooms",
11
- "Planned: matrix-image tool (Nano Banana Pro inline visuals)",
12
- "Deprecated: pair, guest, call tools (replaced by Matrix rooms)"
11
+ "PostToolUse hook polls Matrix bot for ambient message injection"
13
12
  ],
14
13
  "deprecated": [
15
14
  "vibe_pair — use Matrix room invites",