brainstorm-companion 2.0.5 → 2.1.0
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 +15 -9
- package/package.json +1 -1
- package/src/mcp.js +9 -0
- package/src/session.js +9 -0
package/README.md
CHANGED
|
@@ -12,29 +12,35 @@ Zero dependencies. Node.js >= 18 only.
|
|
|
12
12
|
npm install -g brainstorm-companion
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### Claude Code MCP Setup
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
npx brainstorm-companion start
|
|
19
|
-
```
|
|
17
|
+
Add to `~/.claude/.mcp.json` (create the file if it doesn't exist):
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"brainstorm": {
|
|
23
|
+
"command": "brainstorm-companion",
|
|
24
|
+
"args": ["--mcp"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
Then restart Claude Code. The agent gets 5 tools (`brainstorm_start_session`, `brainstorm_push_screen`, `brainstorm_read_events`, `brainstorm_clear_screen`, `brainstorm_stop_session`) with full usage docs embedded — it knows how to use them immediately.
|
|
24
31
|
|
|
32
|
+
**Alternative (no global install):** Use `npx` instead:
|
|
25
33
|
```json
|
|
26
34
|
{
|
|
27
35
|
"mcpServers": {
|
|
28
36
|
"brainstorm": {
|
|
29
37
|
"command": "npx",
|
|
30
|
-
"args": ["brainstorm-companion", "--mcp"]
|
|
38
|
+
"args": ["brainstorm-companion@latest", "--mcp"]
|
|
31
39
|
}
|
|
32
40
|
}
|
|
33
41
|
}
|
|
34
42
|
```
|
|
35
43
|
|
|
36
|
-
Once configured, the agent has access to 5 tools: `brainstorm_start_session`, `brainstorm_push_screen`, `brainstorm_read_events`, `brainstorm_clear_screen`, and `brainstorm_stop_session`. Full documentation is embedded in the tool descriptions — the agent becomes an expert immediately upon connecting.
|
|
37
|
-
|
|
38
44
|
---
|
|
39
45
|
|
|
40
46
|
## Complete Usage Guide
|
package/package.json
CHANGED
package/src/mcp.js
CHANGED
|
@@ -317,6 +317,15 @@ Use clear_after_read: true between brainstorming rounds to avoid stale events.`,
|
|
|
317
317
|
fs.writeFileSync(path.join(slotDir, '.label'), String(label), 'utf8');
|
|
318
318
|
}
|
|
319
319
|
} else {
|
|
320
|
+
// Single-screen mode: clear any existing slot dirs so server doesn't stay in comparison mode
|
|
321
|
+
try {
|
|
322
|
+
const entries = fs.readdirSync(this.sessionDir, { withFileTypes: true });
|
|
323
|
+
for (const entry of entries) {
|
|
324
|
+
if (entry.isDirectory() && entry.name.startsWith('slot-')) {
|
|
325
|
+
fs.rmSync(path.join(this.sessionDir, entry.name), { recursive: true, force: true });
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
} catch { /* ignore */ }
|
|
320
329
|
filePath = path.join(this.sessionDir, `screen-${Date.now()}.html`);
|
|
321
330
|
}
|
|
322
331
|
|
package/src/session.js
CHANGED
|
@@ -111,6 +111,15 @@ class SessionManager {
|
|
|
111
111
|
fs.writeFileSync(path.join(slotDir, '.label'), String(label), 'utf8');
|
|
112
112
|
}
|
|
113
113
|
} else {
|
|
114
|
+
// Single-screen mode: clear any existing slot dirs so server switches out of comparison mode
|
|
115
|
+
try {
|
|
116
|
+
const entries = fs.readdirSync(sessionDir, { withFileTypes: true });
|
|
117
|
+
for (const entry of entries) {
|
|
118
|
+
if (entry.isDirectory() && entry.name.startsWith('slot-')) {
|
|
119
|
+
fs.rmSync(path.join(sessionDir, entry.name), { recursive: true, force: true });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
} catch { /* ignore */ }
|
|
114
123
|
filePath = path.join(sessionDir, filename || `screen-${Date.now()}.html`);
|
|
115
124
|
}
|
|
116
125
|
|