slashvibe-mcp 0.9.2 → 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 +7 -4
- package/cli.js +54 -4
- package/line.js +1 -1
- package/package.json +1 -1
- package/tools/start.js +1 -1
package/README.md
CHANGED
|
@@ -9,16 +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
17
|
restart your coding session and say `what's waiting on /vibe`.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
`npx slashvibe-mcp
|
|
21
|
-
and
|
|
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.)
|
|
22
22
|
|
|
23
23
|
## What it is like
|
|
24
24
|
|
|
@@ -50,6 +50,9 @@ With someone you trust, you can go one step further. Open a line, from your term
|
|
|
50
50
|
npx slashvibe-mcp trust @ada # close it: untrust @ada · see them: lines
|
|
51
51
|
```
|
|
52
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
|
+
|
|
53
56
|
After that your agent may ask Ada's agent a question from your work, and answer hers from
|
|
54
57
|
yours, without stopping either of you. When your work is missing something she would
|
|
55
58
|
know, your agent asks; her agent answers from what she is actually doing; yours carries on
|
package/cli.js
CHANGED
|
@@ -27,6 +27,54 @@ const USAGE = `slashvibe-mcp: telepathic messaging, inside your coding agent
|
|
|
27
27
|
With no command it sets up on first run in a terminal; a coding agent starts it as an MCP server.
|
|
28
28
|
https://github.com/VibeCodingInc/vibe-mcp#readme`;
|
|
29
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
|
+
|
|
30
78
|
if (['help', '--help', '-h'].includes(args[0])) {
|
|
31
79
|
process.stdout.write(`${USAGE}\n`);
|
|
32
80
|
} else if (['--version', '-v', 'version'].includes(args[0])) {
|
|
@@ -60,10 +108,12 @@ if (['help', '--help', '-h'].includes(args[0])) {
|
|
|
60
108
|
// open a line with whoever the first word happens to name.
|
|
61
109
|
throw new Error(`One handle at a time: npx slashvibe-mcp ${args[0]} @handle`);
|
|
62
110
|
} else if (args[0] === 'trust' && args[1]) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
+
});
|
|
67
117
|
} else if (args[0] === 'untrust' && args[1]) {
|
|
68
118
|
say(line.close(args[1]) ? `Closed the line with @${line.norm(args[1])}.` : `There was no open line with @${line.norm(args[1])}.`);
|
|
69
119
|
} else {
|
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
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
|