slashvibe-mcp 0.9.1 → 0.9.3

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 CHANGED
@@ -9,12 +9,16 @@ already prepared from what you are doing. Your part is to say yes.
9
9
  ## Install
10
10
 
11
11
  ```bash
12
- npx slashvibe-mcp
12
+ npx slashvibe-mcp setup
13
13
  ```
14
14
 
15
15
  It configures your coding agent, opens GitHub to sign you in (your GitHub username becomes
16
16
  your @handle), and installs the hooks that let messages reach you in Claude Code. Then
17
- restart your coding session.
17
+ restart your coding session and say `what's waiting on /vibe`.
18
+
19
+ It works from your own terminal or when your coding agent runs it for you. (The bare
20
+ `npx slashvibe-mcp` is what a coding agent launches as the server; without a terminal it
21
+ installs nothing and says so.)
18
22
 
19
23
  ## What it is like
20
24
 
@@ -46,6 +50,9 @@ With someone you trust, you can go one step further. Open a line, from your term
46
50
  npx slashvibe-mcp trust @ada # close it: untrust @ada · see them: lines
47
51
  ```
48
52
 
53
+ The command checks that you are signed in and that @ada exists, and tells you who that is
54
+ before it opens the line; a handle /vibe does not know opens nothing.
55
+
49
56
  After that your agent may ask Ada's agent a question from your work, and answer hers from
50
57
  yours, without stopping either of you. When your work is missing something she would
51
58
  know, your agent asks; her agent answers from what she is actually doing; yours carries on
@@ -83,7 +90,7 @@ the scheduler lease") and it sets it; nothing is taken from your repository.
83
90
 
84
91
  ## The whole surface
85
92
 
86
- Eight tools, for the agent:
93
+ Eight tools, for the agent (plus `vibe_init` and `vibe_token`, which only handle sign-in):
87
94
 
88
95
  | tool | what it does |
89
96
  |---|---|
package/auth-store.js CHANGED
@@ -126,10 +126,10 @@ function hydrate() {
126
126
 
127
127
  _hydrated = true;
128
128
 
129
- if (_token) {
130
- console.error('[auth-store] Hydrated: @' + _handle);
131
- } else {
132
- console.error('[auth-store] Hydrated: no token');
129
+ // Diagnostic only. Unconditional, this was the first line a newcomer read
130
+ // when they ran the install command.
131
+ if (process.env.VIBE_DEBUG) {
132
+ console.error(_token ? '[auth-store] Hydrated: @' + _handle : '[auth-store] Hydrated: no token');
133
133
  }
134
134
  } catch (e) {
135
135
  console.error('[auth-store] Hydration failed:', e.message);
package/cli.js CHANGED
@@ -14,7 +14,79 @@
14
14
 
15
15
  const args = process.argv.slice(2);
16
16
 
17
- if (args[0] === 'hook') {
17
+ const COMMANDS = ['setup', 'hook', 'trust', 'untrust', 'lines', 'quiet', 'unquiet', 'mute', 'unmute'];
18
+ const USAGE = `slashvibe-mcp: telepathic messaging, inside your coding agent
19
+
20
+ npx slashvibe-mcp setup install: configure your coding agent and sign in with GitHub
21
+ npx slashvibe-mcp hook status are the Claude Code hooks installed (also: install, uninstall)
22
+ npx slashvibe-mcp trust @handle open a line with someone you trust (close: untrust @handle)
23
+ npx slashvibe-mcp lines who you have an open line with
24
+ npx slashvibe-mcp quiet nothing reaches you while you work (undo: unquiet)
25
+ npx slashvibe-mcp mute @handle one person stops surfacing (undo: unmute @handle)
26
+
27
+ With no command it sets up on first run in a terminal; a coding agent starts it as an MCP server.
28
+ https://github.com/VibeCodingInc/vibe-mcp#readme`;
29
+
30
+ /**
31
+ * `trust @handle`: open a line, but only with a person who is really there.
32
+ *
33
+ * Refuses, in order and before anything is written: a malformed handle; a
34
+ * person who is not signed in (a line is between two identities); their own
35
+ * handle; a handle /vibe does not know; and any failure to find out (fail
36
+ * closed: "could not check" never opens a line). Then says who it is, in
37
+ * words built here from allow-listed fields, never the server's raw text.
38
+ */
39
+ async function trust(typed, line, say) {
40
+ const h = line.norm(typed);
41
+ if (!line.validHandle(h)) throw new Error(`"${typed}" is not a handle. A handle looks like @sam: letters, digits, - and _.`);
42
+
43
+ const config = require('./config');
44
+ const authStore = require('./auth-store');
45
+ const cred = authStore.inspectToken(config.getAuthToken());
46
+ if (!cred.ok) throw new Error('Sign in first: npx slashvibe-mcp setup');
47
+ if (String(cred.handle || '').toLowerCase() === h) throw new Error(`@${h} is you.`);
48
+
49
+ const base = String(config.getApiUrl ? config.getApiUrl() : (process.env.VIBE_API_URL || 'https://www.slashvibe.dev')).replace(/\/+$/, '');
50
+ const controller = new AbortController();
51
+ const timer = setTimeout(() => controller.abort(), 8000);
52
+ let status; let who = null;
53
+ try {
54
+ const response = await fetch(`${base}/api/identity/${encodeURIComponent(h)}`, { signal: controller.signal, headers: { Accept: 'application/json' } });
55
+ status = response.status;
56
+ if (response.ok) who = await response.json().catch(() => null);
57
+ } catch {
58
+ throw new Error(`Could not reach /vibe to check that @${h} exists. Try again in a moment.`);
59
+ } finally {
60
+ clearTimeout(timer);
61
+ }
62
+ if (status === 404) throw new Error(`There is no @${h} on /vibe. Check the spelling with the person.`);
63
+ if (status !== 200 || !who || String(who.handle || '').toLowerCase() !== h) {
64
+ throw new Error(`Could not confirm that @${h} exists (the check did not answer clearly). Try again in a moment.`);
65
+ }
66
+
67
+ const since = Number.isFinite(Date.parse(who.since)) ? new Date(who.since).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' }) : null;
68
+ const operator = typeof who.operator === 'string' && line.validHandle(line.norm(who.operator)) ? line.norm(who.operator) : null;
69
+ const what = who.kind === 'agent' ? `an agent${operator ? ` run by @${operator}` : ''}` : who.kind === 'human' ? 'a person' : 'an account';
70
+ say(`@${h} is ${what} on /vibe${since ? `, since ${since}` : ''}.`);
71
+
72
+ line.open(h);
73
+ say(`Open line with @${h}.`);
74
+ say(`Your agent may now ask @${h}'s agent a question from your work, and answer theirs from yours, without stopping you. It is told to give information about the work only; the code caps it at ${line.MAX_PER_HOUR} messages an hour, refuses anything shaped like a credential, and marks each message as your agent's, unread by you. You are told what was said. It works both ways only if @${h} opens one with you.`);
75
+ say(`Close it: npx slashvibe-mcp untrust @${h}`);
76
+ }
77
+
78
+ if (['help', '--help', '-h'].includes(args[0])) {
79
+ process.stdout.write(`${USAGE}\n`);
80
+ } else if (['--version', '-v', 'version'].includes(args[0])) {
81
+ process.stdout.write(`${require('./package.json').version}\n`);
82
+ } else if (args[0] && process.stdin.isTTY && !COMMANDS.includes(args[0]) && !args.includes('setup')) {
83
+ // A person typed something we do not know. This used to fall through to the
84
+ // full setup: "--help" wrote agent configs and opened GitHub in a browser.
85
+ // Only on a terminal: a host that launches the server with arguments of its
86
+ // own must still get the server.
87
+ process.stderr.write(`Unknown command: ${args[0]}\n\n${USAGE}\n`);
88
+ process.exitCode = 1;
89
+ } else if (args[0] === 'hook') {
18
90
  require('./hook-cli')
19
91
  .run(args.slice(1))
20
92
  .catch((error) => {
@@ -31,11 +103,17 @@ if (args[0] === 'hook') {
31
103
  const line = require('./line');
32
104
  const say = (t) => process.stdout.write(`${t}\n`);
33
105
  try {
34
- if (args[0] === 'trust' && args[1]) {
35
- const h = line.open(args[1]);
36
- say(`Open line with @${h}.`);
37
- say(`Your agent may now ask @${h}'s agent a question from your work, and answer theirs from yours, without stopping you. It is told to give information about the work only; the code caps it at ${line.MAX_PER_HOUR} messages an hour, refuses anything shaped like a credential, and marks each message as your agent's, unread by you. You are told what was said. It works both ways only if @${h} opens one with you.`);
38
- say(`Close it: npx slashvibe-mcp untrust @${h}`);
106
+ if (['trust', 'untrust'].includes(args[0]) && args.length > 2) {
107
+ // One handle, exactly as typed. "trust @sam and @ada" must not quietly
108
+ // open a line with whoever the first word happens to name.
109
+ throw new Error(`One handle at a time: npx slashvibe-mcp ${args[0]} @handle`);
110
+ } else if (args[0] === 'trust' && args[1]) {
111
+ // Opening a line is a grant to a specific person, so it is checked like
112
+ // one: a typo must not hand the line to whoever owns the misspelling.
113
+ trust(args[1], line, say).catch((error) => {
114
+ process.stderr.write(`${error?.message || error}\nNo line was opened.\n`);
115
+ process.exitCode = 1;
116
+ });
39
117
  } else if (args[0] === 'untrust' && args[1]) {
40
118
  say(line.close(args[1]) ? `Closed the line with @${line.norm(args[1])}.` : `There was no open line with @${line.norm(args[1])}.`);
41
119
  } else {
@@ -102,10 +180,21 @@ if (args[0] === 'hook') {
102
180
  console.log('Commands:');
103
181
  console.log(' npx slashvibe-mcp setup — re-run setup wizard');
104
182
  console.log('');
105
- console.log('In Claude Code, just say "who\'s vibing?" to get started.');
183
+ console.log('In your coding agent, say "what\'s waiting on /vibe" to get started.');
106
184
  process.exit(0);
107
185
  }
108
186
  } else {
109
- // Running as MCP server (stdin is a pipe from Claude Code)
187
+ // Running as MCP server (stdin is a pipe from Claude Code).
188
+ //
189
+ // The same shape is an agent running the install line for its person from a
190
+ // shell tool: no terminal, so no setup, and until now no word of why. Say it
191
+ // once on stderr (a host ignores it; an agent's shell shows it). Only before
192
+ // first sign-in, so a working install stays silent.
193
+ try {
194
+ const config = require('./config');
195
+ if (!config.isInitialized() && !config.getAuthToken()) {
196
+ process.stderr.write('slashvibe-mcp: no terminal here, so this started as an MCP server and is waiting for a coding agent. To install /vibe, run: npx slashvibe-mcp setup\n');
197
+ }
198
+ } catch {}
110
199
  require('./index.js');
111
200
  }
package/line.js CHANGED
@@ -122,6 +122,6 @@ const stripMark = (body) => String(body || '').replace(/\n\n\((asked|answered) b
122
122
 
123
123
  module.exports = {
124
124
  open, close, list, isOpen, record, receipts, sentThisHour, looksSecret,
125
- ASKED, ANSWERED, isAgentAnswer, isAgentAsk, stripMark, norm,
125
+ ASKED, ANSWERED, isAgentAnswer, isAgentAsk, stripMark, norm, validHandle,
126
126
  MAX_PER_HOUR, MAX_CHARS, ANSWER_WINDOW_MS,
127
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slashvibe-mcp",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "mcpName": "io.github.vibecodinginc/vibe",
5
5
  "description": "Telepathic messaging between people, from inside their coding agent sessions (Claude Code, Codex, Cursor)",
6
6
  "main": "index.js",
package/setup.js CHANGED
@@ -40,7 +40,7 @@ const API_BASE = 'https://www.slashvibe.dev';
40
40
  function printBanner() {
41
41
  console.log(`
42
42
  ${colors.green} █░█ █ █▄▄ █▀▀${colors.reset}
43
- ${colors.green} ▀▄▀ █ █▄█ ██▄${colors.reset} ${colors.dim}ask here · answer there${colors.reset}
43
+ ${colors.green} ▀▄▀ █ █▄█ ██▄${colors.reset} ${colors.dim}telepathic messaging, inside your coding agent${colors.reset}
44
44
  ──────────────────────────────────────────────────
45
45
  `);
46
46
  }
@@ -523,8 +523,6 @@ async function setup() {
523
523
  console.log(`${colors.dim} 1. Check your internet connection${colors.reset}`);
524
524
  console.log(`${colors.dim} 2. Try: ${colors.cyan}curl -s https://www.slashvibe.dev/api/health${colors.reset}`);
525
525
  console.log(`${colors.dim} 3. If that works, try setup again${colors.reset}`);
526
- console.log('');
527
- console.log(`${colors.dim} Status page: ${colors.cyan}slashvibe.dev/status${colors.reset}`);
528
526
  process.exit(1);
529
527
  }
530
528
 
@@ -545,6 +543,10 @@ async function setup() {
545
543
  oauth = await beginOAuth({ actorAware: true });
546
544
  openBrowser(oauth.loginUrl);
547
545
  console.log(`${colors.dim} → Waiting for authentication...${colors.reset}`);
546
+ // Always say where to go. The browser may have opened on a screen nobody is
547
+ // looking at (SSH), or not at all, and "waiting" with no link is a dead end.
548
+ console.log(`${colors.dim} → If no browser opened, open this to sign in:${colors.reset}`);
549
+ console.log(` ${colors.cyan}${oauth.loginUrl}${colors.reset}`);
548
550
 
549
551
  const authResult = await oauth.waitForCallback();
550
552
 
@@ -580,7 +582,8 @@ async function setup() {
580
582
 
581
583
  console.log(`${colors.bold} Quick start:${colors.reset}`);
582
584
  console.log(`${colors.dim} 1. Restart your coding agent${detected.length > 1 ? `s (${detected.join(', ')})` : ''}${colors.reset}`);
583
- console.log(`${colors.dim} 2. Say: "message @their-handle — ..." to someone you already know${colors.reset}`);
585
+ console.log(`${colors.dim} 2. Say: "what's waiting on /vibe" to see who has written to you${colors.reset}`);
586
+ console.log(`${colors.dim} or: "message @their-handle: ..." to someone you already know${colors.reset}`);
584
587
  // Receiving is the product: a reply has to reach you while you work, not
585
588
  // when you remember to ask. So the hooks are installed here, by default,
586
589
  // for Claude Code — stated plainly, with the one command that removes them.
@@ -644,7 +647,7 @@ async function setup() {
644
647
  }
645
648
  if (oauth && err.message !== 'AUTH_TIMEOUT') await oauth.cancel();
646
649
  console.log('');
647
- console.log(`${colors.dim} Need help? slashvibe.dev/help${colors.reset}`);
650
+ console.log(`${colors.dim} Need help? https://github.com/VibeCodingInc/vibe-mcp/issues${colors.reset}`);
648
651
  // On timeout the shared listener remains live during its grace window so a
649
652
  // late browser callback gets the explanatory page instead of a refusal.
650
653
  process.exitCode = 1;
package/store/api.js CHANGED
@@ -515,9 +515,9 @@ async function sendMessage(from, to, body, type = 'dm', payload = null, options
515
515
  }
516
516
  }
517
517
 
518
- console.error('[vibe] Sending request to endpoint:', endpoint, 'with data:', JSON.stringify(data).substring(0, 200));
518
+ // Never log the request or the response here: both carry the message text,
519
+ // and a host keeps an MCP server's stderr in its log files.
519
520
  const result = await request('POST', endpoint, data);
520
- console.error('[vibe] Got result:', JSON.stringify(result).substring(0, 300));
521
521
 
522
522
  // Handle auth errors
523
523
  if (!result.success && result.error?.includes('Authentication')) {
package/tools/init.js CHANGED
@@ -60,9 +60,9 @@ function formatPresenceLabel({ humans = 0, agents = 0 } = {}) {
60
60
  */
61
61
  function generatePreAuthBanner(presence) {
62
62
  const label = formatPresenceLabel(presence);
63
- const onlineText = label ? `🟢 ${label}` : '🟢 join the crew';
63
+ const onlineText = label ? `🟢 ${label}` : 'not signed in yet';
64
64
  return `
65
- █░█ █ █▄▄ █▀▀ ask here · answer there
65
+ █░█ █ █▄▄ █▀▀ telepathic messaging
66
66
  ▀▄▀ █ █▄█ ██▄ ${onlineText}
67
67
  ──────────────────────────────────────────────────
68
68
  `;
package/tools/start.js CHANGED
@@ -98,7 +98,7 @@ async function handler(args = {}) {
98
98
  } else if (inboxRead && threads.length === 0) {
99
99
  // /vibe takes two. A newcomer with nobody to talk to needs the one next
100
100
  // step that makes it work, in words they can send as they are.
101
- display += '\n\nno conversations yet. /vibe takes two: send the person you work with this, then message them.\n npx slashvibe-mcp';
101
+ display += '\n\nno conversations yet. /vibe takes two: send the person you work with this, then message them.\n npx slashvibe-mcp setup';
102
102
  }
103
103
 
104
104
  // Conversations that ended on their words and were read: "unread" alone