bus-agent 2.3.0 → 2.3.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/README.md +36 -14
- package/SKILL.md +1 -1
- package/coco-cli.js +1 -1
- package/lib/bus.js +1 -1
- package/lib/mcp.js +1 -1
- package/lib/orchestrator.js +3 -3
- package/lib/scheduler.js +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Universal Agent Communication Hub** — Connect any AI agent to any other.
|
|
4
4
|
|
|
5
|
-
[](https://github.com/ClewCode/bus-agent)
|
|
6
6
|
|
|
7
7
|
MCP CoCo is a **message bus** for AI agents. It supports both the [MCP Protocol](https://modelcontextprotocol.io) (Model Context Protocol) and direct file-based access. Agents such as OpenClaw, Hermes, Claude Desktop, Cursor, OpenCode, and Claude Code CLI can all connect and communicate through a shared bus.
|
|
8
8
|
|
|
@@ -206,17 +206,19 @@ node coco-cli.js backup --list
|
|
|
206
206
|
npm install -g bus-agent
|
|
207
207
|
npx bus-agent
|
|
208
208
|
|
|
209
|
-
# Or from source:
|
|
210
|
-
git clone https://github.com/ClewCode/
|
|
211
|
-
cd
|
|
209
|
+
# Or from source (local folder still 'mcp-coco'):
|
|
210
|
+
git clone https://github.com/ClewCode/bus-agent.git
|
|
211
|
+
cd bus-agent
|
|
212
212
|
|
|
213
213
|
# MCP mode (for any MCP client)
|
|
214
214
|
node index.js
|
|
215
215
|
|
|
216
216
|
# CLI mode (for scripts / terminal agents)
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
npx bus-agent # Run as MCP server (stdio)
|
|
218
|
+
# Or with global install:
|
|
219
|
+
coco status # Check bus health
|
|
220
|
+
coco agents # List registered agents
|
|
221
|
+
coco send hermes "Hello" # Send a DM
|
|
220
222
|
|
|
221
223
|
# Webhook gateway (optional)
|
|
222
224
|
node webhook-gateway.js 8080
|
|
@@ -230,22 +232,36 @@ Add the following to your MCP client configuration:
|
|
|
230
232
|
{
|
|
231
233
|
"mcpServers": {
|
|
232
234
|
"coco": {
|
|
233
|
-
"command": "
|
|
234
|
-
"args": ["
|
|
235
|
+
"command": "npx",
|
|
236
|
+
"args": ["bus-agent"]
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
239
|
}
|
|
238
240
|
```
|
|
239
241
|
|
|
240
|
-
Or
|
|
242
|
+
Or from a local clone:
|
|
241
243
|
|
|
242
|
-
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"mcpServers": {
|
|
247
|
+
"coco": {
|
|
248
|
+
"command": "node",
|
|
249
|
+
"args": ["/path/to/bus-agent/index.js"]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Environment Variables
|
|
243
256
|
|
|
244
257
|
```bash
|
|
245
|
-
#
|
|
246
|
-
export COCO_AGENT=
|
|
258
|
+
# Your agent name on the bus
|
|
259
|
+
export COCO_AGENT=my-agent
|
|
247
260
|
# Windows (PowerShell)
|
|
248
|
-
$env:COCO_AGENT = "
|
|
261
|
+
$env:COCO_AGENT = "my-agent"
|
|
262
|
+
|
|
263
|
+
# Optional: custom data directory (default: ./.bus/ in CWD)
|
|
264
|
+
export BUS_DIR=/path/to/my-bus-data
|
|
249
265
|
```
|
|
250
266
|
|
|
251
267
|
---
|
|
@@ -280,6 +296,12 @@ $env:COCO_AGENT = "opencode"
|
|
|
280
296
|
|
|
281
297
|
All bus state is stored as plain JSON files on disk. No database or external service required.
|
|
282
298
|
|
|
299
|
+
The data directory (`.bus/`) is resolved at runtime:
|
|
300
|
+
1. `$BUS_DIR` environment variable (if set)
|
|
301
|
+
2. `$CWD/.bus/` (current working directory — **default**)
|
|
302
|
+
|
|
303
|
+
This means each user/project gets **their own isolated data**. No cross-user data sharing. The `.bus/` folder is gitignored by default.
|
|
304
|
+
|
|
283
305
|
---
|
|
284
306
|
|
|
285
307
|
## Data Layout
|
package/SKILL.md
CHANGED
package/coco-cli.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
const path = require('path');
|
|
23
23
|
const fs = require('fs');
|
|
24
24
|
|
|
25
|
-
const BUS_DIR = path.join(
|
|
25
|
+
const BUS_DIR = process.env.BUS_DIR || path.join(process.cwd(), '.bus');
|
|
26
26
|
const AGENTS_FILE = path.join(BUS_DIR, 'agents.json');
|
|
27
27
|
const MSGS_DIR = path.join(BUS_DIR, 'messages');
|
|
28
28
|
const CHANNELS_DIR = path.join(BUS_DIR, 'channels');
|
package/lib/bus.js
CHANGED
|
@@ -12,7 +12,7 @@ const fs = require('fs');
|
|
|
12
12
|
const path = require('path');
|
|
13
13
|
const { EventEmitter } = require('events');
|
|
14
14
|
|
|
15
|
-
const DATA_DIR = path.join(
|
|
15
|
+
const DATA_DIR = process.env.BUS_DIR || path.join(process.cwd(), '.bus');
|
|
16
16
|
const AGENTS_FILE = path.join(DATA_DIR, 'agents.json');
|
|
17
17
|
const MSGS_DIR = path.join(DATA_DIR, 'messages');
|
|
18
18
|
const CHANNELS_DIR = path.join(DATA_DIR, 'channels');
|
package/lib/mcp.js
CHANGED
|
@@ -428,7 +428,7 @@ class MCPServer {
|
|
|
428
428
|
|
|
429
429
|
// Init memory store
|
|
430
430
|
const { MemoryStore } = require('./memory');
|
|
431
|
-
this.memory = new MemoryStore(path.join(
|
|
431
|
+
this.memory = new MemoryStore(process.env.BUS_DIR || path.join(process.cwd(), '.bus'));
|
|
432
432
|
|
|
433
433
|
// Init scheduler & orchestrator
|
|
434
434
|
this.scheduler = new Scheduler(this.bus);
|
package/lib/orchestrator.js
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
const fs = require('fs');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
|
|
12
|
-
const RULES_FILE = path.join(
|
|
13
|
-
const WORKFLOWS_FILE = path.join(
|
|
12
|
+
const RULES_FILE = path.join(process.env.BUS_DIR || path.join(process.cwd(), '.bus'), 'auto-reply-rules.json');
|
|
13
|
+
const WORKFLOWS_FILE = path.join(process.env.BUS_DIR || path.join(process.cwd(), '.bus'), 'workflows.json');
|
|
14
14
|
|
|
15
15
|
class Orchestrator {
|
|
16
16
|
constructor(bus) {
|
|
@@ -250,7 +250,7 @@ class Orchestrator {
|
|
|
250
250
|
// Long-poll for reply
|
|
251
251
|
// We use a one-time waiter on the requester's inbox
|
|
252
252
|
const agentName = requester || 'coco';
|
|
253
|
-
const inboxDir = path.join(
|
|
253
|
+
const inboxDir = path.join(process.env.BUS_DIR || path.join(process.cwd(), '.bus'), 'messages', agentName);
|
|
254
254
|
|
|
255
255
|
const startCount = fs.existsSync(inboxDir)
|
|
256
256
|
? fs.readdirSync(inboxDir).filter(f => f.endsWith('.json')).length
|
package/lib/scheduler.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
const fs = require('fs');
|
|
25
25
|
const path = require('path');
|
|
26
26
|
|
|
27
|
-
const SCHEDULE_FILE = path.join(
|
|
27
|
+
const SCHEDULE_FILE = path.join(process.env.BUS_DIR || path.join(process.cwd(), '.bus'), 'schedule.json');
|
|
28
28
|
|
|
29
29
|
class Scheduler {
|
|
30
30
|
constructor(bus) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bus-agent",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "Universal Agent Communication Hub — Connect any AI agent to any other. MCP bus with messaging, channels, memory, scheduling, workflows, and diagnostics.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/ClewCode/
|
|
26
|
+
"url": "git+https://github.com/ClewCode/bus-agent.git"
|
|
27
27
|
},
|
|
28
28
|
"bugs": {
|
|
29
|
-
"url": "https://github.com/ClewCode/
|
|
29
|
+
"url": "https://github.com/ClewCode/bus-agent/issues"
|
|
30
30
|
},
|
|
31
|
-
"homepage": "https://github.com/ClewCode/
|
|
31
|
+
"homepage": "https://github.com/ClewCode/bus-agent#readme",
|
|
32
32
|
"keywords": [
|
|
33
33
|
"mcp",
|
|
34
34
|
"model-context-protocol",
|