bus-agent 2.3.4 → 2.3.6
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/{.env.coco → .env.bus} +1 -1
- package/AGENTS.md +6 -6
- package/README.md +176 -230
- package/SKILL.md +35 -35
- package/backup.js +4 -4
- package/bridge.js +5 -5
- package/bus-aliases.sh +10 -0
- package/{coco-cli.js → bus-cli.js} +18 -18
- package/{coco-tool.js → bus-tool.js} +13 -13
- package/bus.js +26 -0
- package/claude-mcp.json +2 -2
- package/clients/{coco-client.ts → bus-client.ts} +6 -6
- package/clients/{coco_client.py → bus_client.py} +7 -7
- package/cursor-mcp.json +1 -1
- package/doctor.js +1 -1
- package/hermes-forwarder.js +1 -1
- package/hermes.example.json +2 -2
- package/index.js +1 -1
- package/lib/backup.js +9 -9
- package/lib/bus.js +1 -1
- package/lib/daemon.js +7 -7
- package/lib/doctor.js +4 -4
- package/lib/mcp.js +10 -10
- package/lib/memory.js +1 -1
- package/lib/orchestrator.js +1 -1
- package/lib/scheduler.js +2 -2
- package/lib/tunnel.js +12 -12
- package/mcporter.example.json +2 -2
- package/opencode-mcp.json +2 -2
- package/package.json +9 -9
- package/scripts/install.bat +1 -1
- package/scripts/install.ps1 +10 -10
- package/setup.js +32 -32
- package/tunnel.js +2 -2
- package/webhook-gateway.js +2 -2
- package/coco-aliases.sh +0 -10
- package/coco.js +0 -26
package/setup.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Bus Config Wizard — Interactive setup for connecting agents to the Bus
|
|
4
4
|
*
|
|
5
5
|
* Generates MCP configs, env files, and bus registration for:
|
|
6
6
|
* - OpenCode / Clew Code
|
|
7
7
|
* - Claude Code
|
|
8
8
|
* - Cursor
|
|
9
9
|
* - Any MCP client
|
|
10
|
-
* - CLI agents (via
|
|
10
|
+
* - CLI agents (via bus-cli.js)
|
|
11
11
|
*
|
|
12
12
|
* Usage:
|
|
13
13
|
* node setup.js # Interactive wizard
|
|
@@ -54,7 +54,7 @@ function generateMCPJson(serverName, command, args) {
|
|
|
54
54
|
|
|
55
55
|
function generateMcpConfigOpenCode() {
|
|
56
56
|
return generateMCPJson(
|
|
57
|
-
'
|
|
57
|
+
'bus-agent',
|
|
58
58
|
'node',
|
|
59
59
|
[path.join(COCO_DIR, 'index.js')]
|
|
60
60
|
);
|
|
@@ -62,7 +62,7 @@ function generateMcpConfigOpenCode() {
|
|
|
62
62
|
|
|
63
63
|
function generateMcpConfigClaudeCode() {
|
|
64
64
|
return generateMCPJson(
|
|
65
|
-
'
|
|
65
|
+
'bus-agent',
|
|
66
66
|
'node',
|
|
67
67
|
[path.join(COCO_DIR, 'index.js')]
|
|
68
68
|
);
|
|
@@ -75,31 +75,31 @@ function generateMcpConfigCursor() {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function generateEnvFile(agentName) {
|
|
78
|
-
return `#
|
|
79
|
-
# Generated by
|
|
78
|
+
return `# Bus Agent Configuration
|
|
79
|
+
# Generated by Bus Config Wizard
|
|
80
80
|
|
|
81
81
|
# Your agent name on the bus
|
|
82
|
-
|
|
82
|
+
BUS_AGENT=${agentName}
|
|
83
83
|
|
|
84
|
-
# Path to the
|
|
84
|
+
# Path to the bus data directory
|
|
85
85
|
COCO_BUS_DIR=${BUS_DIR}
|
|
86
86
|
|
|
87
|
-
#
|
|
88
|
-
|
|
87
|
+
# Bus CLI path (for bus-cli.js)
|
|
88
|
+
BUS_CLI=${path.join(COCO_DIR, 'bus-cli.js')}
|
|
89
89
|
`;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function generateShellAliases() {
|
|
93
93
|
return `
|
|
94
|
-
# ──
|
|
95
|
-
alias bus-agents='node ${path.join(COCO_DIR, '
|
|
96
|
-
alias bus-inbox='node ${path.join(COCO_DIR, '
|
|
97
|
-
alias bus-send='node ${path.join(COCO_DIR, '
|
|
98
|
-
alias bus-whoami='node ${path.join(COCO_DIR, '
|
|
99
|
-
alias bus-status='node ${path.join(COCO_DIR, '
|
|
100
|
-
alias bus-search='node ${path.join(COCO_DIR, '
|
|
101
|
-
alias bus-watch='node ${path.join(COCO_DIR, '
|
|
102
|
-
alias bus-channel='node ${path.join(COCO_DIR, '
|
|
94
|
+
# ── Bus Aliases ──
|
|
95
|
+
alias bus-agents='node ${path.join(COCO_DIR, 'bus-cli.js')} agents'
|
|
96
|
+
alias bus-inbox='node ${path.join(COCO_DIR, 'bus-cli.js')} inbox'
|
|
97
|
+
alias bus-send='node ${path.join(COCO_DIR, 'bus-cli.js')} send'
|
|
98
|
+
alias bus-whoami='node ${path.join(COCO_DIR, 'bus-cli.js')} whoami'
|
|
99
|
+
alias bus-status='node ${path.join(COCO_DIR, 'bus-cli.js')} status'
|
|
100
|
+
alias bus-search='node ${path.join(COCO_DIR, 'bus-cli.js')} search'
|
|
101
|
+
alias bus-watch='node ${path.join(COCO_DIR, 'bus-cli.js')} watch'
|
|
102
|
+
alias bus-channel='node ${path.join(COCO_DIR, 'bus-cli.js')} channel'
|
|
103
103
|
`;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -110,7 +110,7 @@ alias bus-channel='node ${path.join(COCO_DIR, 'coco-cli.js')} channel'
|
|
|
110
110
|
async function wizard() {
|
|
111
111
|
console.log(`
|
|
112
112
|
╔═══════════════════════════════════════════════╗
|
|
113
|
-
║ MCP
|
|
113
|
+
║ MCP Bus — Config Wizard ║
|
|
114
114
|
║ Connect your agents to the Agent Bus ║
|
|
115
115
|
╚═══════════════════════════════════════════════╝
|
|
116
116
|
`);
|
|
@@ -118,7 +118,7 @@ async function wizard() {
|
|
|
118
118
|
const agentName = await question(`What's your agent name? [${process.env.USER || 'agent'}] `) || process.env.USER || 'agent';
|
|
119
119
|
|
|
120
120
|
console.log(`\n🤖 Agent: ${agentName}`);
|
|
121
|
-
console.log(`📁
|
|
121
|
+
console.log(`📁 Bus: ${COCO_DIR}\n`);
|
|
122
122
|
|
|
123
123
|
console.log('Which clients do you want to configure?');
|
|
124
124
|
console.log(' 1) OpenCode / Clew Code');
|
|
@@ -164,7 +164,7 @@ async function wizard() {
|
|
|
164
164
|
║ ✅ Setup Complete! ║
|
|
165
165
|
║ ║
|
|
166
166
|
║ Your agent "${agentName}" is now on the bus ║
|
|
167
|
-
║ Run "node
|
|
167
|
+
║ Run "node bus-cli.js status" to verify ║
|
|
168
168
|
╚═══════════════════════════════════════════════╝
|
|
169
169
|
`);
|
|
170
170
|
}
|
|
@@ -215,17 +215,17 @@ async function setupCursor(agentName) {
|
|
|
215
215
|
|
|
216
216
|
function generateEnvAndAliases(agentName) {
|
|
217
217
|
const envContent = generateEnvFile(agentName);
|
|
218
|
-
const envPath = path.join(COCO_DIR, '.env.
|
|
218
|
+
const envPath = path.join(COCO_DIR, '.env.bus');
|
|
219
219
|
fs.writeFileSync(envPath, envContent, 'utf-8');
|
|
220
220
|
console.log(` ✅ Environment file → ${envPath}`);
|
|
221
221
|
|
|
222
222
|
const aliasContent = generateShellAliases();
|
|
223
|
-
const aliasPath = path.join(COCO_DIR, '
|
|
223
|
+
const aliasPath = path.join(COCO_DIR, 'bus-aliases.sh');
|
|
224
224
|
fs.writeFileSync(aliasPath, aliasContent, 'utf-8');
|
|
225
225
|
console.log(` ✅ Shell aliases → ${aliasPath}`);
|
|
226
226
|
console.log(` Source with: . ${aliasPath}`);
|
|
227
227
|
|
|
228
|
-
return ['.env.
|
|
228
|
+
return ['.env.bus', 'bus-aliases.sh'];
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
function registerAgentOnBus(agentName) {
|
|
@@ -236,7 +236,7 @@ function registerAgentOnBus(agentName) {
|
|
|
236
236
|
const agents = fs.existsSync(agentsFile) ? JSON.parse(fs.readFileSync(agentsFile, 'utf-8')) : {};
|
|
237
237
|
agents[agentName] = {
|
|
238
238
|
name: agentName,
|
|
239
|
-
description: `Setup via
|
|
239
|
+
description: `Setup via Bus Config Wizard`,
|
|
240
240
|
capabilities: [],
|
|
241
241
|
tags: [],
|
|
242
242
|
status: 'idle',
|
|
@@ -253,15 +253,15 @@ function registerAgentOnBus(agentName) {
|
|
|
253
253
|
// ═══════════════════════════════════════════════════════
|
|
254
254
|
|
|
255
255
|
function quickSetup() {
|
|
256
|
-
const agentName = process.env.COCO_AGENT || process.env.USER || 'agent';
|
|
256
|
+
const agentName = process.env.BUS_AGENT || process.env.COCO_AGENT || process.env.USER || 'agent';
|
|
257
257
|
registerAgentOnBus(agentName);
|
|
258
258
|
|
|
259
259
|
// Generate all configs
|
|
260
260
|
fs.writeFileSync(path.join(COCO_DIR, 'opencode-mcp.json'), JSON.stringify(generateMcpConfigOpenCode(), null, 2), 'utf-8');
|
|
261
261
|
fs.writeFileSync(path.join(COCO_DIR, 'claude-mcp.json'), JSON.stringify(generateMcpConfigClaudeCode(), null, 2), 'utf-8');
|
|
262
262
|
fs.writeFileSync(path.join(COCO_DIR, 'cursor-mcp.json'), JSON.stringify(generateMcpConfigCursor(), null, 2), 'utf-8');
|
|
263
|
-
fs.writeFileSync(path.join(COCO_DIR, '.env.
|
|
264
|
-
fs.writeFileSync(path.join(COCO_DIR, '
|
|
263
|
+
fs.writeFileSync(path.join(COCO_DIR, '.env.bus'), generateEnvFile(agentName), 'utf-8');
|
|
264
|
+
fs.writeFileSync(path.join(COCO_DIR, 'bus-aliases.sh'), generateShellAliases(), 'utf-8');
|
|
265
265
|
|
|
266
266
|
console.log(`
|
|
267
267
|
╔═══════════════════════════════════════════════╗
|
|
@@ -271,7 +271,7 @@ function quickSetup() {
|
|
|
271
271
|
║ Generated: opencode-mcp.json ║
|
|
272
272
|
║ claude-mcp.json ║
|
|
273
273
|
║ cursor-mcp.json ║
|
|
274
|
-
║ .env.
|
|
274
|
+
║ .env.bus, bus-aliases.sh ║
|
|
275
275
|
╚═══════════════════════════════════════════════╝
|
|
276
276
|
`);
|
|
277
277
|
}
|
|
@@ -289,7 +289,7 @@ async function main() {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
if (arg === 'list') {
|
|
292
|
-
console.log(`\n📋
|
|
292
|
+
console.log(`\n📋 Agent Bus — Recommended Configs\n`);
|
|
293
293
|
console.log(` 1. OpenCode / Clew Code:`);
|
|
294
294
|
console.log(` Add to .mcp.json:`);
|
|
295
295
|
console.log(` ${JSON.stringify(generateMcpConfigOpenCode(), null, 4).split('\n').map(l => ' ' + l).join('\n')}\n`);
|
|
@@ -301,7 +301,7 @@ async function main() {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
if (arg === 'opencode') {
|
|
304
|
-
registerAgentOnBus(process.env.COCO_AGENT || 'agent');
|
|
304
|
+
registerAgentOnBus(process.env.BUS_AGENT || process.env.COCO_AGENT || 'agent');
|
|
305
305
|
fs.writeFileSync(path.join(COCO_DIR, 'opencode-mcp.json'), JSON.stringify(generateMcpConfigOpenCode(), null, 2), 'utf-8');
|
|
306
306
|
console.log(`✅ OpenCode MCP config generated: opencode-mcp.json`);
|
|
307
307
|
return;
|
package/tunnel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Bus Tunnel — Cross-machine Bus Proxy CLI Wrapper
|
|
4
4
|
*
|
|
5
5
|
* Thin wrapper around lib/tunnel.js
|
|
6
6
|
* Usage:
|
|
@@ -31,7 +31,7 @@ function parseArgs() {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function help() {
|
|
34
|
-
console.log(`\n╔═══════════════════════════════════════════════╗\n║
|
|
34
|
+
console.log(`\n╔═══════════════════════════════════════════════╗\n║ Bus — Tunnel ║\n╚═══════════════════════════════════════════════╝\n`);
|
|
35
35
|
console.log('Usage:');
|
|
36
36
|
console.log(' node tunnel.js server [options] Start tunnel server (receiving end)');
|
|
37
37
|
console.log(' node tunnel.js client [options] Start tunnel client (sending end)');
|
package/webhook-gateway.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Bus Webhook Gateway — Receive external webhooks and post to Agent Bus
|
|
4
4
|
*
|
|
5
5
|
* Features:
|
|
6
6
|
* - GitHub push, PR, issues, Actions CI status
|
|
@@ -392,7 +392,7 @@ fs.writeFileSync(agentsFile, JSON.stringify(agents, null, 2), 'utf-8');
|
|
|
392
392
|
server.listen(PORT, () => {
|
|
393
393
|
console.log(`
|
|
394
394
|
╔══════════════════════════════════════════════╗
|
|
395
|
-
║ MCP
|
|
395
|
+
║ MCP Bus — Webhook Gateway v2.1 ║
|
|
396
396
|
║ http://localhost:${PORT} ║
|
|
397
397
|
╚══════════════════════════════════════════════╝
|
|
398
398
|
|
package/coco-aliases.sh
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# ── CoCo Bus Aliases ──
|
|
3
|
-
alias coco-agents='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js agents'
|
|
4
|
-
alias coco-inbox='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js inbox'
|
|
5
|
-
alias coco-send='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js send'
|
|
6
|
-
alias coco-whoami='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js whoami'
|
|
7
|
-
alias coco-status='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js status'
|
|
8
|
-
alias coco-search='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js search'
|
|
9
|
-
alias coco-watch='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js watch'
|
|
10
|
-
alias coco-channel='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco-cli.js channel'
|
package/coco.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* CoCo — Convenience entry point for CLI agents
|
|
4
|
-
*
|
|
5
|
-
* Usage:
|
|
6
|
-
* node coco.js agents # List agents
|
|
7
|
-
* node coco.js inbox # Check your messages
|
|
8
|
-
* node coco.js send "message" # Send to last reply-to agent
|
|
9
|
-
* node coco.js send <to> msg # Send to specific agent
|
|
10
|
-
* node coco.js watch # Watch for new messages
|
|
11
|
-
*/
|
|
12
|
-
const { execSync } = require('child_process');
|
|
13
|
-
const path = require('path');
|
|
14
|
-
|
|
15
|
-
const CLI = path.join(__dirname, 'coco-cli.js');
|
|
16
|
-
const args = process.argv.slice(2).join(' ');
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
const result = execSync(`node "${CLI}" ${args}`, {
|
|
20
|
-
encoding: 'utf-8',
|
|
21
|
-
stdio: 'inherit',
|
|
22
|
-
env: { ...process.env },
|
|
23
|
-
});
|
|
24
|
-
} catch (e) {
|
|
25
|
-
// errors already shown via stdio
|
|
26
|
-
}
|