bus-agent 2.3.3 → 2.3.5

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
@@ -1,15 +1,15 @@
1
- # MCP CoCo
1
+ # Bus Agent
2
2
 
3
3
  **Universal Agent Communication Hub** — Connect any AI agent to any other.
4
4
 
5
5
  [![GitHub](https://img.shields.io/badge/GitHub-ClewCode%2Fbus--agent-blue)](https://github.com/ClewCode/bus-agent)
6
6
 
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.
7
+ Bus Agent is a **message bus** for AI agents. It supports both the [MCP Protocol](https://modelcontextprotocol.io) 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
 
9
9
  ```
10
10
  ┌─────────────────────────────┐
11
11
  OpenClaw │ │ Hermes Agent
12
- ────▶│ MCP CoCo (Agent Bus) │◀────
12
+ ────▶│ Bus Agent (Agent Bus) │◀────
13
13
  Claude │ │ Cursor
14
14
  ────▶│ 40+ tools / CLI / SDKs │◀────
15
15
  OpenCode │ │ Claude Code CLI
@@ -23,60 +23,59 @@ OpenCode │ │ Claude Code CLI
23
23
 
24
24
  ### Agent Profiles & Discovery
25
25
 
26
- - **Rich Profiles** — Each agent carries metadata: model info (provider, name, context window), capabilities, tags, operational status, version, connection endpoints.
27
- - **Auto-Discovery** — When a new agent registers, the bus broadcasts a `joined` event to all connected agents. The new agent receives a welcome message via DM.
28
- - **Search & Filter** — Query agents by name, capability, model, tag, or status. Supports text search across descriptions and capabilities.
29
- - **Stale Detection** — Agents that miss heartbeats for 5 minutes are automatically marked offline.
26
+ - **Rich profiles** — Each agent carries metadata: model info (provider, name, context window), capabilities, tags, operational status, version, connection endpoints.
27
+ - **Auto-discovery** — When a new agent registers, the bus broadcasts a `joined` event to all connected agents. The new agent receives a welcome message via DM.
28
+ - **Search & filter** — Query agents by name, capability, model, tag, or status. Supports text search across descriptions and capabilities.
29
+ - **Stale detection** — Agents that miss heartbeats for 5 minutes are automatically marked offline.
30
30
 
31
31
  ### Messaging
32
32
 
33
- - **Direct Messages** — Send private messages between any two agents.
33
+ - **Direct messages** — Send private messages between any two agents.
34
34
  - **Broadcast** — Send a message to every agent on the bus.
35
35
  - **Channels** — Group chat rooms for multi-agent conversations.
36
- - **Long-Poll** — `message_wait` blocks until a new message arrives (configurable timeout, up to 60s).
37
- - **Filtered Inbox** — Retrieve messages from specific senders or after a given cursor.
38
-
39
- ### CLI (coco-cli.js)
40
-
41
- ```
42
- node coco-cli.js agents [--online] [--capability X] [--tag Y] [--model Z] [--status S]
43
- node coco-cli.js profile [agent]
44
- node coco-cli.js profile edit --status busy --description "..."
45
- node coco-cli.js search <query>
46
- node coco-cli.js status
47
- node coco-cli.js subscribe <channel>
48
- node coco-cli.js channel list|create <name>|join|send|history
49
- node coco-cli.js inbox [agent] [--from X] [--unread]
50
- node coco-cli.js events [since]
51
- node coco-cli.js watch [agent]
52
- node coco-cli.js doctor [--quick] [--fix]
53
- node coco-cli.js tunnel server|client|sync|ssh [options]
54
- node coco-cli.js backup [--list|--restore|--diff|--cleanup]
55
- ```
36
+ - **Long-poll** — `message_wait` blocks until a new message arrives (configurable timeout, up to 60s).
37
+ - **Filtered inbox** — Retrieve messages from specific senders or after a given cursor.
56
38
 
57
39
  ### Scheduler
58
40
 
59
- - **Cron Expressions** — Schedule recurring messages using standard cron syntax: `0 9 * * 1-5` sends to a channel or agent every weekday at 09:00.
60
- - **One-Shot Scheduling** — Specify an ISO timestamp (`at`) for single-delivery messages. The job is automatically disabled after firing.
61
- - **Timezone Support** — Each job can specify its own IANA timezone (e.g., `Asia/Bangkok`).
41
+ - **Cron expressions** — Schedule recurring messages using standard cron syntax.
42
+ - **One-shot scheduling** — Specify an ISO timestamp for single-delivery messages.
43
+ - **Timezone support** — Each job can specify its own IANA timezone (e.g., `Asia/Bangkok`).
62
44
 
63
45
  ### Auto-Reply Rules
64
46
 
65
- - **Pattern Matching** — Define rules that automatically forward, reply, or broadcast when a message matches criteria (by sender, text content, regex, or metadata fields).
66
- - **Message Transformation** — Use templates with `{message}`, `{from}`, `{channel}` variables.
67
- - **Loop Protection** — Each rule has a configurable `max_loops` limit to prevent infinite chains.
47
+ - **Pattern matching** — Define rules that automatically forward, reply, or broadcast when a message matches criteria.
48
+ - **Message transformation** — Use templates with `{message}`, `{from}`, `{channel}` variables.
49
+ - **Loop protection** — Configurable `max_loops` limit to prevent infinite chains.
68
50
 
69
51
  ### Agent Orchestrator
70
52
 
71
- - **Multi-Step Workflows** — Define a pipeline of agents connected in sequence. Output from step N becomes input to step N+1 via variable substitution.
72
- - **Variable Chaining** — `{input}` → agent A stores result as `{review_result}` → agent B receives `{review_result}`.
73
- - **Per-Step Timeout** — Individual timeout per agent step; failed steps are reported without blocking the caller indefinitely.
53
+ - **Multi-step workflows** — Define a pipeline of agents connected in sequence. Output from step N becomes input to step N+1.
54
+ - **Variable chaining** — `{input}` → agent A stores result as `{review_result}` → agent B receives `{review_result}`.
55
+ - **Per-step timeout** — Individual timeout per agent step; failed steps are reported without blocking.
56
+
57
+ ### Memory Layer
58
+
59
+ Agent memory system with dual-mode search:
60
+
61
+ - **Vector search (ANN)** — Cosine similarity via Ollama (nomic-embed-text, 768-dim), OpenAI, or custom endpoint.
62
+ - **TF-IDF keyword search** — Built-in scoring with recency boost, zero external dependencies.
63
+ - **Storage** — Append-only JSONL per agent in `.bus/memory/{agent}/`.
64
+ - **Namespaces, TTL, archive, rebuild, search** — 10 MCP tools.
65
+
66
+ | Feature | Description |
67
+ |---------|-------------|
68
+ | Namespaces | Categorize memories (preferences, system, archive, etc.) |
69
+ | TTL | Auto-expire memories after a set duration |
70
+ | Archive | Move old inbox messages into memory store |
71
+ | Rebuild | Regenerate all vector embeddings from stored content |
72
+ | Pluggable | Switch between keyword, Ollama, OpenAI, or custom |
74
73
 
75
74
  ### Webhook Gateway
76
75
 
77
76
  | Endpoint | Purpose |
78
77
  |----------|---------|
79
- | `POST /webhook/github/:channel` | GitHub push, pull request, issue, comment events |
78
+ | `POST /webhook/github/:channel` | GitHub push, PR, issue, comment events |
80
79
  | `POST /webhook/github-actions/:channel` | GitHub Actions CI workflow status |
81
80
  | `POST /webhook/gitlab/:channel` | GitLab push, merge request events |
82
81
  | `POST /webhook/slack/:channel` | Slack messages |
@@ -87,146 +86,37 @@ node coco-cli.js backup [--list|--restore|--diff|--cleanup]
87
86
  | `GET /api/channels` | List registered channels |
88
87
  | `GET /api/agents` | List agents on the bus |
89
88
 
90
- ### External Bridges
91
-
92
- A bridge module (`bridge.js`) provides a template for two-way communication between the bus and external platforms. Supports Slack, Discord, and custom generic bridges via HTTP listener. Channel mapping externalizes bus channels to platform-specific channels.
93
-
94
89
  ### Client SDKs
95
90
 
96
91
  - **Python** — `clients/coco_client.py` provides `CoCoClient` with methods for registration, messaging, and channel operations.
97
92
  - **TypeScript** — `clients/coco-client.ts` provides the same interface for Node.js environments.
98
93
 
99
- ### Config Wizard
100
-
101
- ```
102
- node setup.js # Interactive wizard
103
- node setup.js --quick # Quick setup with defaults
104
- node setup.js list # Display config examples
105
- ```
106
-
107
- Generates `.mcp.json` configuration files for OpenCode, Claude Code, and Cursor, along with environment files (`.env.coco`) and shell aliases (`coco-aliases.sh`).
108
-
109
- ### OpenClaw Native Integration
110
-
111
- The `coco-tool.js` wrapper provides direct file-based access to the bus without requiring an MCP transport layer:
112
-
113
- ```bash
114
- node coco-tool.js agent_register '{"name":"agent","capabilities":["chat","code"]}'
115
- node coco-tool.js agent_search '{"query":"code"}'
116
- node coco-tool.js message_send '{"from":"agent","to":"hermes","message":"Hello"}'
117
- node coco-tool.js workflow_run '{"workflow_id":"review-and-deploy","input":"..."}'
118
- ```
119
-
120
- ### Bus Doctor
121
-
122
- Diagnostics and health checking for the CoCo bus. Verifies bus directory integrity, agent registry validity, orphaned agents, stale PID files, message inbox sizes, channel consistency, schedule/rule/workflow validity, and event log integrity.
123
-
124
- ```bash
125
- node doctor.js # Full diagnostic report
126
- node doctor.js --quick # Summary only
127
- node doctor.js --fix # Auto-fix minor issues (missing dirs, stale PIDs, corrupted files)
128
- node doctor.js --report # Save report to .bus/diagnostic-report.json
129
- node doctor.js --watch # Watch mode (check every 30s)
130
-
131
- # Via CLI
132
- node coco-cli.js doctor --fix
133
- ```
134
-
135
- 18 checks are performed:
136
- - Bus directory existence & permissions
137
- - Required subdirectories (messages, channels, events)
138
- - Agent registry — profiles, missing fields, stale agents (>24h)
139
- - Orphaned agents (registered but never active, >7 days)
140
- - Message inbox sizes & file integrity
141
- - Channel metadata & log file integrity
142
- - Schedule file validity
143
- - Auto-reply rule validity
144
- - Workflow definition validity
145
- - Disk usage
146
- - Stale PID files
147
- - Event log integrity
148
-
149
- ### CoCo Tunnel
150
-
151
- Cross-machine bus proxy. Expose a local CoCo bus to a remote machine (or vice versa) via HTTP REST, with optional authentication and sync.
152
-
153
- ```bash
154
- # Server mode (receiving end)
155
- node tunnel.js server --port 9090 --secret mytoken
156
-
157
- # Client mode (sending end — pushes local agents & messages)
158
- node tunnel.js client --host 192.168.1.100 --port 9090 --secret mytoken
159
-
160
- # Bidirectional sync (merge agents both ways)
161
- node tunnel.js sync --remote http://192.168.1.100:9090 --interval 5000
162
-
163
- # SSH tunnel helper — prints port-forwarding instructions
164
- node tunnel.js ssh --remote user@server.example.com
165
-
166
- # Via CLI
167
- node coco-cli.js tunnel server --port 9090 --secret mytoken
168
- ```
169
-
170
- **Endpoints (server):**
171
-
172
- | Method | Path | Description |
173
- |--------|------|-------------|
174
- | GET | `/health` | Server status + agent count |
175
- | GET | `/bus/agents` | List bus agents |
176
- | GET | `/bus/file/:path` | Read a bus file |
177
- | POST | `/bus/send` | Send message to bus |
178
- | POST | `/bus/write` | Write a bus file |
179
- | POST | `/bus/register` | Register an agent remotely |
180
-
181
- ### Backup & Restore
182
-
183
- Gzip-compressed backup of the entire `.bus/` directory with checksum verification. Supports restore, diff, auto-backup, and cleanup.
94
+ ### External Bridges
184
95
 
185
- ```bash
186
- node backup.js # Create timestamped backup in .backups/
187
- node backup.js --out mybackup.coco # Custom output path
188
- node backup.js --list # List available backups
189
- node backup.js --info <file> # Show backup metadata & contents
190
- node backup.js --restore <file> # Restore bus from backup (auto-creates pre-restore backup)
191
- node backup.js --diff <file> # Compare backup with current bus state
192
- node backup.js --cleanup 30 # Remove backups older than 30 days
193
- node backup.js --auto # Backup only if changes detected
194
- node backup.js --watch 60 # Auto-backup every 60 minutes
195
-
196
- # Via CLI
197
- node coco-cli.js backup --list
198
- ```
96
+ The bridge module (`bridge.js`) provides a template for two-way communication between the bus and external platforms (Slack, Discord, custom).
199
97
 
200
98
  ---
201
99
 
202
100
  ## Quick Start
203
101
 
204
102
  ```bash
205
- # Via npm (recommended)
103
+ # Install globally
206
104
  npm install -g bus-agent
207
- npx bus-agent
208
105
 
209
- # Or from source (local folder still 'mcp-coco'):
210
- git clone https://github.com/ClewCode/bus-agent.git
211
- cd bus-agent
212
-
213
- # MCP mode (for any MCP client)
214
- node index.js
106
+ # MCP server mode (stdio for any MCP client)
107
+ npx bus-agent
215
108
 
216
- # CLI mode (for scripts / terminal agents)
217
- npx bus-agent # Run as MCP server (stdio)
218
- # Or with global install:
219
- bus status # Check bus health
220
- bus agents # List registered agents
221
- bus send hermes "Hello" # Send a DM
109
+ # CLI mode
110
+ bus status
111
+ bus agents
112
+ bus send hermes "Hello"
222
113
 
223
- # Webhook gateway (optional)
114
+ # Webhook gateway
115
+ bus-agent --daemon
224
116
  node webhook-gateway.js 8080
225
117
  ```
226
118
 
227
- ### For MCP Agents
228
-
229
- Add the following to your MCP client configuration:
119
+ ### MCP Client Configuration
230
120
 
231
121
  ```json
232
122
  {
@@ -255,13 +145,8 @@ Or from a local clone:
255
145
  ### Environment Variables
256
146
 
257
147
  ```bash
258
- # Your agent name on the bus
259
- export COCO_AGENT=my-agent
260
- # Windows (PowerShell)
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
148
+ export COCO_AGENT=my-agent # Your agent name on the bus
149
+ export BUS_DIR=/path/to/data # Custom data directory (default: ./.bus/ in CWD)
265
150
  ```
266
151
 
267
152
  ---
@@ -275,113 +160,174 @@ export BUS_DIR=/path/to/my-bus-data
275
160
  └──────┬────────────────┘
276
161
 
277
162
  ┌──────────┐ ┌────────┴────────────────────────┐ ┌──────────┐
278
- │ OpenClaw │────▶│ MCP CoCo (Agent Bus) │◀────│ Hermes │
163
+ │ OpenClaw │────▶│ Bus Agent (Agent Bus) │◀────│ Hermes │
279
164
  │ (skill) │ │ │ │ Agent │
280
165
  ├──────────┤ │ .bus/agents.json │ ├──────────┤
281
166
  │ Claude │────▶│ .bus/messages/ │◀────│ Cursor │
282
167
  │ Code │ │ .bus/channels/ │ │ │
283
168
  ├──────────┤ │ .bus/events/ │ ├──────────┤
284
- │ OpenCode │────▶│ .bus/schedule.json │◀────│ CLI │
285
- │ (clew) │ └────────┬─────────────────────────┘ │ agents │
286
- └──────────┘└──────────┘
287
- │\
169
+ │ OpenCode │────▶│ .bus/memory/ │◀────│ CLI │
170
+ │ (clew) │ │ .bus/schedule.json │ │ agents │
171
+ └──────────┘ └────────┬─────────────────────────┘ └──────────┘
288
172
 
289
- ┌────────────────┴────────────────────┐\
290
- │ Utility Layer │\
291
- doctor.js — Diagnostics & Auto-Fix │\
292
- tunnel.js — Cross-machine Proxy │\
293
- backup.js — Backup, Restore & Diff │\
173
+ ┌────────────────┴────────────────────┐
174
+ │ Utility Layer
175
+ Doctor — Diagnostics & Auto-Fix
176
+ Tunnel — Cross-machine Proxy
177
+ Backup — Backup, Restore & Diff
294
178
  └─────────────────────────────────────┘
295
179
  ```
296
180
 
297
- All bus state is stored as plain JSON files on disk. No database or external service required.
298
-
299
- The data directory (`.bus/`) is resolved at runtime:
181
+ **Data storage** is resolved at runtime:
300
182
  1. `$BUS_DIR` environment variable (if set)
301
- 2. `$CWD/.bus/` (current working directory — **default**)
183
+ 2. `./.bus/` in current working directory (default)
302
184
 
303
- This means each user/project gets **their own isolated data**. No cross-user data sharing. The `.bus/` folder is gitignored by default.
185
+ Each user/project gets isolated data. The `.bus/` folder is gitignored by default.
304
186
 
305
- ---
306
-
307
- ## Data Layout
187
+ ### Data Layout
308
188
 
309
189
  ```
310
190
  .bus/
311
191
  agents.json # Agent registry with profiles
312
192
  messages/
313
- <agent_name>/ # Per-agent inbox (JSON message files)
314
- <agent_name>_outbox/ # Sent messages archive
193
+ <agent>/ # Per-agent inbox (JSON message files)
315
194
  channels/
316
195
  <id>.json # Channel metadata
317
196
  <id>/log/ # Channel message history
318
197
  events/
319
- YYYY-MM-DD.jsonl # System events log (JSONL format)
198
+ YYYY-MM-DD.jsonl # System events log (JSONL)
320
199
  schedule.json # Scheduled jobs
321
200
  auto-reply-rules.json # Auto-reply rules
322
- workflows.json # Workflow definitions
201
+ workflows.json # Workflow definitions
323
202
  memory/
324
- <agent>/ # Per-agent memories
325
- memories.jsonl # Append-only memory log (JSONL)
203
+ <agent>/
204
+ memories.jsonl # Append-only memory log
326
205
  index.json # TF-IDF inverted index
327
- vectors.json # Vector embeddings (when provider configured)
206
+ vectors.json # Vector embeddings (when configured)
328
207
  config.json # Embedding provider config
208
+ .backups/ # Backup archives
329
209
  ```
330
210
 
331
211
  ---
332
212
 
333
- ## Tools Reference
213
+ ## CLI Reference
214
+
215
+ ```bash
216
+ bus agents [--online] [--capability X] [--tag Y] [--status S]
217
+ bus whoami
218
+ bus profile [agent]
219
+ bus profile edit --status busy --description "..."
220
+ bus search <query>
221
+ bus status
222
+ bus subscribe <channel>
223
+ bus channel list | create <name> | join | send | history
224
+ bus inbox [agent] [--from X] [--unread]
225
+ bus send <to> <message>
226
+ bus reply <msg-id> <message>
227
+ bus events [since]
228
+ bus watch [agent]
229
+
230
+ bus doctor [--quick] [--fix] [--report] [--watch]
231
+ bus tunnel server|client|sync|ssh [--port] [--secret] [--host] [--remote] [--interval]
232
+ bus backup [--list] [--restore] [--diff] [--cleanup] [--auto] [--watch]
233
+
234
+ bus memory store <agent> <content> [--key] [--namespace] [--ttl]
235
+ bus memory search <agent> <query> [--limit] [--namespace]
236
+ bus memory recall <agent> <id>
237
+ bus memory list <agent> [--namespace] [--limit]
238
+ bus memory forget <agent> <id>
239
+ bus memory stats <agent>
240
+ bus memory archive <agent> [--max-age-days] [--no-delete]
241
+ bus memory configure --provider <keyword|ollama|openai|custom> [options]
242
+ bus memory rebuild <agent>
243
+ bus memory clear <agent> [--namespace]
244
+ ```
334
245
 
335
- The MCP server exposes 43 tools across 9 categories:
246
+ ---
247
+
248
+ ## MCP Tools (43)
336
249
 
337
250
  | Category | Count | Tools |
338
251
  |----------|-------|-------|
339
- | Agent Registry | 7 | `agent_register`, `agent_update_profile`, `agent_get_profile`, `agent_list`, `agent_search`, `agent_heartbeat`, `agent_set_status` |
340
- | Messages | 5 | `message_send`, `message_broadcast`, `message_fetch`, `message_wait`, `message_delete` |
341
- | Channels | 5 | `channel_create`, `channel_join`, `channel_leave`, `channel_send`, `channel_history` |
342
- | System Events | 2 | `system_get_events`, `system_wait_for_event` |
343
- | Scheduler | 3 | `scheduler_add`, `scheduler_remove`, `scheduler_list` |
344
- | Auto-Reply | 3 | `auto_reply_add`, `auto_reply_remove`, `auto_reply_list` |
345
- | Workflows | 4 | `workflow_create`, `workflow_run`, `workflow_remove`, `workflow_list` |
346
- | Memory | 10 | `memory_store`, `memory_search`, `memory_recall`, `memory_list`, `memory_forget`, `memory_stats`, `memory_archive`, `memory_clear`, `memory_configure`, `memory_rebuild` |
252
+ | Agent Registry | 7 | `register`, `update_profile`, `get_profile`, `list`, `search`, `heartbeat`, `set_status` |
253
+ | Messages | 5 | `send`, `broadcast`, `fetch`, `wait`, `delete` |
254
+ | Channels | 5 | `create`, `join`, `leave`, `send`, `history` |
255
+ | System Events | 2 | `get_events`, `wait_for_event` |
256
+ | Scheduler | 3 | `add`, `remove`, `list` |
257
+ | Auto-Reply | 3 | `add`, `remove`, `list` |
258
+ | Workflows | 4 | `create`, `run`, `remove`, `list` |
259
+ | Memory | 10 | `store`, `search`, `recall`, `list`, `forget`, `stats`, `archive`, `clear`, `configure`, `rebuild` |
347
260
  | Utilities | 4 | `coco_health`, `ask_hermes`, `hermes_send`, `hermes_channels` |
348
261
 
349
- ## Memory Layer
262
+ All tools are prefixed with their category (e.g., `agent_register`, `memory_search`). Full schemas via MCP `tools/list` or `bus help`.
350
263
 
351
- Agent memory system with dual-mode search:
264
+ ---
352
265
 
353
- - **Vector search (ANN)** — Cosine similarity via Ollama (nomic-embed-text, 768-dim), OpenAI, or custom endpoint
354
- - **TF-IDF keyword search** — Built-in scoring with recency boost, zero external deps
266
+ ## Utility Tools
355
267
 
356
- **Storage:** Append-only JSONL per agent in `.bus/memory/{agent}/`
268
+ ### Doctor
357
269
 
358
- | Feature | Description |
359
- |---------|-------------|
360
- | Namespaces | Categorize memories (preferences, system, archive, etc.) |
361
- | TTL | Auto-expire memories after a set duration |
362
- | Archive | Move old inbox messages into memory store |
363
- | Rebuild | Regenerate all vector embeddings from stored content |
364
- | Pluggable | Switch between keyword, Ollama, OpenAI, or custom |
270
+ Diagnostics and health checking. Verifies bus directory integrity, agent registry validity, orphaned agents, stale PID files, message inbox sizes, channel consistency, schedule/rule/workflow validity, and event log integrity.
365
271
 
366
272
  ```bash
367
- bus memory store andul "Jonus likes clean architecture" --key architecture-pref --namespace preferences
368
- bus memory search andul "architecture layers" --limit 5
369
- bus memory configure --provider ollama --endpoint http://localhost:11434 --model nomic-embed-text
370
- bus memory rebuild andul
371
- bus memory archive andul --max-age-days 7
273
+ bus doctor [--quick] [--fix] [--report] [--watch]
372
274
  ```
373
275
 
374
- ## Utility Tools
276
+ 18 diagnostic checks: directory existence, permissions, required subdirectories, agent profiles, orphaned agents, stale agents (>24h), message file integrity, channel metadata, schedule/rule/workflow validity, disk usage, stale PIDs, event log integrity.
277
+
278
+ ### Tunnel
279
+
280
+ Cross-machine bus proxy. Expose a local bus to a remote machine via HTTP REST with optional authentication and sync.
281
+
282
+ ```bash
283
+ bus tunnel server --port 9090 --secret mytoken
284
+ bus tunnel client --host 192.168.1.100 --port 9090 --secret mytoken
285
+ bus tunnel sync --remote http://192.168.1.100:9090 --interval 5000
286
+ bus tunnel ssh --remote user@server.example.com
287
+ ```
288
+
289
+ | Endpoint | Method | Description |
290
+ |----------|--------|-------------|
291
+ | `/health` | GET | Server status + agent count |
292
+ | `/bus/agents` | GET | List bus agents |
293
+ | `/bus/file/:path` | GET | Read a bus file |
294
+ | `/bus/send` | POST | Send message to bus |
295
+ | `/bus/write` | POST | Write a bus file |
296
+ | `/bus/register` | POST | Register an agent remotely |
297
+
298
+ ### Backup
299
+
300
+ Gzip-compressed backup of the entire `.bus/` directory with SHA-256 checksum.
301
+
302
+ ```bash
303
+ bus backup # Create timestamped backup
304
+ bus backup --list # List available backups
305
+ bus backup --info <file> # Show metadata & contents
306
+ bus backup --restore <file> # Restore (auto pre-restore backup)
307
+ bus backup --diff <file> # Compare with current state
308
+ bus backup --cleanup [days] # Remove old backups
309
+ bus backup --auto # Backup only if changes detected
310
+ bus backup --watch [minutes] # Auto-backup every N minutes
311
+ ```
312
+
313
+ ---
314
+
315
+ ## Performance
316
+
317
+ ![benchmark](./benchmark.svg)
375
318
 
376
- Three standalone (also integrated into `coco-cli.js`) tools augment the bus:
319
+ **Environment:** Node v24.12.0 · Windows Server · File-based (no database)
377
320
 
378
- | Tool | File | Purpose |
379
- |------|------|---------|
380
- | Doctor | `doctor.js` / `lib/doctor.js` | Diagnostics, health checks, auto-fix |
381
- | Tunnel | `tunnel.js` / `lib/tunnel.js` | Cross-machine bus proxy & sync |
382
- | Backup | `backup.js` / `lib/backup.js` | Compressed backup, restore, diff |
321
+ | Metric | Result |
322
+ |--------|--------|
323
+ | Message throughput | 1,082 msg/sec |
324
+ | Memory writes | 25,000/sec |
325
+ | Read inbox (25 msgs) | 0.54 ms/msg |
326
+ | List + filter 20 agents | <0.05 ms/agent |
327
+ | Keyword search (100 entries) | <0.01 ms/entry |
328
+ | Store 1 memory (JSONL append) | 40 μs |
383
329
 
384
- Full tool schemas are available via MCP `tools/list` or by running `node coco-cli.js help`.
330
+ File-based bus achieves these speeds because there is zero network overhead, no serialization beyond `JSON.parse`, and append-only JSONL for memory writes. The bottleneck on NTFS is directory listing at high file counts; ext4/apfs will perform even better.
385
331
 
386
332
  ---
387
333
 
package/SKILL.md CHANGED
@@ -185,24 +185,24 @@ CLI agents (OpenCode, Claude Code, shell scripts) can access the message bus **d
185
185
  export COCO_AGENT=opencode
186
186
 
187
187
  # List agents
188
- node coco-cli.js agents
188
+ node bus-cli.js agents
189
189
 
190
190
  # Check inbox
191
- node coco-cli.js inbox
191
+ node bus-cli.js inbox
192
192
 
193
193
  # Send a message
194
- node coco-cli.js send andul "Hello from OpenCode!"
194
+ node bus-cli.js send andul "Hello from OpenCode!"
195
195
 
196
196
  # Reply to a specific message
197
- node coco-cli.js reply <message-id> "Thanks!"
197
+ node bus-cli.js reply <message-id> "Thanks!"
198
198
 
199
199
  # Watch for new messages (poll every 2s)
200
- node coco-cli.js watch
200
+ node bus-cli.js watch
201
201
 
202
202
  # Or use the shorter wrapper
203
- node coco.js agents
204
- node coco.js inbox
205
- node coco.js send andul "Hey!"
203
+ node bus.js agents
204
+ node bus.js inbox
205
+ node bus.js send andul "Hey!"
206
206
  ```
207
207
 
208
208
  ## One-liner for OpenCode
@@ -211,7 +211,7 @@ Set this in your shell profile:
211
211
  ```bash
212
212
  # ~/.bashrc or ~/.zshrc or $PROFILE (PowerShell)
213
213
  export COCO_AGENT=opencode
214
- alias coco='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco.js'
214
+ alias bus='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus.js'
215
215
  ```
216
216
 
217
217
  Then just:
@@ -276,7 +276,7 @@ Diagnostics and health checks for the CoCo bus:
276
276
  ```bash
277
277
  node doctor.js [--quick] [--fix] [--report] [--watch]
278
278
  # or via CLI
279
- node coco-cli.js doctor [--quick] [--fix]
279
+ node bus-cli.js doctor [--quick] [--fix]
280
280
  ```
281
281
 
282
282
  Performs 18 checks: bus directory, permissions, agent registry (profiles, stale agents), orphaned agents, message integrity, channels, scheduler validity, auto-reply rules, workflows, disk usage, stale PIDs, event logs. With `--fix`, auto-creates missing directories, removes stale PID files, deletes corrupted messages.
@@ -291,7 +291,7 @@ node tunnel.js client --host <ip> --port 9090 --secret ***
291
291
  node tunnel.js sync --remote http://<ip>:9090
292
292
  node tunnel.js ssh --remote user@host
293
293
  # or via CLI
294
- node coco-cli.js tunnel server --port 9090 --secret ***
294
+ node bus-cli.js tunnel server --port 9090 --secret ***
295
295
  ```
296
296
 
297
297
  Server exposes HTTP endpoints: `/health`, `/bus/agents`, `/bus/send`, `/bus/register`. Client pushes local agents and recent messages at configurable interval. Sync mode merges agent registries bidirectionally.
@@ -308,7 +308,7 @@ node backup.js --diff <file> # Compare with current state
308
308
  node backup.js --cleanup 30 # Remove old backups
309
309
  node backup.js --watch 60 # Auto-backup every 60 min
310
310
  # or via CLI
311
- node coco-cli.js backup --list
311
+ node bus-cli.js backup --list
312
312
  ```
313
313
 
314
314
  Backups stored in `.backups/` directory. Each backup includes checksum verification. Diff shows added/removed/modified files.
package/bin/cli.js CHANGED
@@ -14,28 +14,37 @@ const args = process.argv.slice(2);
14
14
 
15
15
  if (args.includes('--help') || args.includes('-h')) {
16
16
  console.log(`
17
- MCP Bus — MCP Bridge: OpenClaw ↔ Hermes Agent
17
+ MCP Bus — Agent Communication Hub
18
18
 
19
19
  Usage:
20
- bus-agent Run as stdio MCP server (for mcporter)
20
+ bus-agent Run as stdio MCP server (for MCP clients)
21
21
  bus-agent --daemon Start background daemon
22
22
  bus-agent --health Quick health check (exit 0 = ok)
23
23
  bus-agent --help Show this help
24
24
 
25
25
  Examples:
26
26
  # Run as stdio server (connect via mcporter):
27
- mcporter add coco --stdio "node path/to/index.js"
27
+ mcporter config add bus-agent --stdio "bus-agent"
28
28
 
29
29
  # Start as background daemon:
30
30
  bus-agent --daemon
31
31
 
32
- # Call from OpenClaw:
33
- mcporter call coco.ask_hermes prompt="Hello Hermes"
34
-
35
32
  # Check health:
36
33
  bus-agent --health
37
34
  `);
38
35
  process.exit(0);
39
36
  }
40
37
 
38
+ if (args.includes('--health')) {
39
+ const { AgentBus } = require(path.join(__dirname, '..', 'lib', 'bus'));
40
+ try {
41
+ const bus = new AgentBus();
42
+ const busDir = process.env.BUS_DIR || path.join(process.cwd(), '.bus');
43
+ const ok = require('fs').existsSync(path.join(busDir, 'agents.json'));
44
+ process.exit(ok ? 0 : 1);
45
+ } catch {
46
+ process.exit(1);
47
+ }
48
+ }
49
+
41
50
  require(path.join(__dirname, '..', 'index.js'));
@@ -1,10 +1,10 @@
1
1
 
2
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'
3
+ alias coco-agents='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js agents'
4
+ alias coco-inbox='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js inbox'
5
+ alias coco-send='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js send'
6
+ alias coco-whoami='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js whoami'
7
+ alias coco-status='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js status'
8
+ alias coco-search='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js search'
9
+ alias coco-watch='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js watch'
10
+ alias coco-channel='node E:\_system\.openclaw\workspace\repos\mcp-coco\bus-cli.js channel'
@@ -1,23 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * CoCo CLI v2.1 Direct bus interface for CLI agents
3
+ * Bus CLI v2.3.3 - Direct bus interface for CLI agents
4
4
  *
5
- * No MCP needed. Direct file access to the CoCo Agent Bus.
5
+ * No MCP needed. Direct file access to the Bus Agent Bus.
6
6
  *
7
7
  * Usage:
8
- * node coco-cli.js agents # List all agents (with filters)
9
- * node coco-cli.js whoami # Show your agent identity
10
- * node coco-cli.js inbox [agent] # Show inbox messages
11
- * node coco-cli.js send <to> <message> # Send a message
12
- * node coco-cli.js reply <msg-id> <message> # Reply to a message
13
- * node coco-cli.js profile [agent] # Show profile
14
- * node coco-cli.js profile edit --status busy # Edit your profile
15
- * node coco-cli.js search <query> # Search agents
16
- * node coco-cli.js status # Show CoCo + your agent status
17
- * node coco-cli.js subscribe <channel> # Listen to channel messages
18
- * node coco-cli.js channel list|send|history # Channel operations
19
- * node coco-cli.js events [since] # View system events
20
- * node coco-cli.js watch [agent] # Watch for new messages
8
+ * bus agents # List all agents (with filters)
9
+ * bus whoami # Show your agent identity
10
+ * bus inbox [agent] # Show inbox messages
11
+ * bus send <to> <message> # Send a message
12
+ * bus reply <msg-id> <message> # Reply to a message
13
+ * bus profile [agent] # Show profile
14
+ * bus profile edit --status busy # Edit your profile
15
+ * bus search <query> # Search agents
16
+ * bus status # Show Bus + your agent status
17
+ * bus subscribe <channel> # Listen to channel messages
18
+ * bus channel list|send|history # Channel operations
19
+ * bus events [since] # View system events
20
+ * bus watch [agent] # Watch for new messages
21
21
  */
22
22
  const path = require('path');
23
23
  const fs = require('fs');
@@ -123,7 +123,7 @@ function cmdAgents(filterArgs) {
123
123
  (a.description || '').toLowerCase().includes(filters.search.toLowerCase())
124
124
  );
125
125
 
126
- console.log(`\n🤖 Agents on CoCo Bus (${list.length} total):`);
126
+ console.log(`\n🤖 Agents on Bus (${list.length} total):`);
127
127
  console.log('─'.repeat(70));
128
128
 
129
129
  list.sort((a, b) => new Date(b[1].last_seen) - new Date(a[1].last_seen));
@@ -201,7 +201,7 @@ function cmdInbox(agentName, extra) {
201
201
 
202
202
  function cmdSend(to, text) {
203
203
  if (!to || !text) {
204
- console.log('Usage: node coco-cli.js send <to> <message>');
204
+ console.log('Usage: bus send <to> <message>');
205
205
  process.exit(1);
206
206
  }
207
207
  const from = process.env.COCO_AGENT || process.env.USER || 'anonymous';
@@ -220,7 +220,7 @@ function cmdSend(to, text) {
220
220
 
221
221
  function cmdReply(msgId, text) {
222
222
  if (!msgId || !text) {
223
- console.log('Usage: node coco-cli.js reply <msg-id> <message>');
223
+ console.log('Usage: bus reply <msg-id> <message>');
224
224
  process.exit(1);
225
225
  }
226
226
  const from = process.env.COCO_AGENT || process.env.USER || 'anonymous';
@@ -340,7 +340,7 @@ function cmdProfileEdit(edits) {
340
340
 
341
341
  function cmdSearch(query) {
342
342
  if (!query) {
343
- console.log('Usage: node coco-cli.js search <query>');
343
+ console.log('Usage: bus search <query>');
344
344
  console.log('Searches agent names, descriptions, capabilities, and tags');
345
345
  return;
346
346
  }
@@ -391,7 +391,7 @@ function cmdStatus() {
391
391
 
392
392
  console.log(`
393
393
  ╔══════════════════════════════════════════╗
394
- MCP CoCo — Agent Bus Status
394
+ Bus Agent — Agent Bus Status
395
395
  ╚══════════════════════════════════════════╝`);
396
396
  console.log(` You: ${myName} ${myOnline ? '🟢 online' : '⚫ offline'}`);
397
397
  console.log(` Bus agents: ${Object.keys(agents).length} total (${online.length} online, ${offline.length} offline)`);
@@ -419,7 +419,7 @@ function cmdStatus() {
419
419
 
420
420
  function cmdSubscribe(channelId) {
421
421
  if (!channelId) {
422
- console.log('Usage: node coco-cli.js subscribe <channel>');
422
+ console.log('Usage: bus subscribe <channel>');
423
423
  console.log('Listens to channel messages in real-time.');
424
424
  process.exit(1);
425
425
  }
@@ -573,7 +573,7 @@ function cmdChannel(subArgs) {
573
573
  if (sub === 'create') {
574
574
  const chId = subArgs[1];
575
575
  const topic = subArgs.slice(2).join(' ') || '';
576
- if (!chId) { console.log('Usage: node coco-cli.js channel create <name> [topic]'); return; }
576
+ if (!chId) { console.log('Usage: bus channel create <name> [topic]'); return; }
577
577
  const ch = { id: chId, topic, created_by: process.env.COCO_AGENT || 'cli', created_at: new Date().toISOString(), members: [] };
578
578
  fs.writeFileSync(path.join(CHANNELS_DIR, `${chId}.json`), JSON.stringify(ch, null, 2), 'utf-8');
579
579
  console.log(`✅ Channel "#${chId}" created`);
@@ -583,7 +583,7 @@ function cmdChannel(subArgs) {
583
583
  if (sub === 'join') {
584
584
  const chId = subArgs[1];
585
585
  const agentName = subArgs[2] || process.env.COCO_AGENT || process.env.USER || 'anonymous';
586
- if (!chId) { console.log('Usage: node coco-cli.js channel join <name> [agent]'); return; }
586
+ if (!chId) { console.log('Usage: bus channel join <name> [agent]'); return; }
587
587
  const chPath = path.join(CHANNELS_DIR, `${chId}.json`);
588
588
  if (!fs.existsSync(chPath)) { console.log(`❌ Channel "${chId}" not found`); return; }
589
589
  const ch = JSON.parse(fs.readFileSync(chPath, 'utf-8'));
@@ -597,7 +597,7 @@ function cmdChannel(subArgs) {
597
597
  const channelId = subArgs[1];
598
598
  const text = subArgs.slice(2).join(' ');
599
599
  if (!channelId || !text) {
600
- console.log('Usage: node coco-cli.js channel send <channel> <message>');
600
+ console.log('Usage: bus channel send <channel> <message>');
601
601
  return;
602
602
  }
603
603
  const from = process.env.COCO_AGENT || process.env.USER || 'anonymous';
@@ -672,7 +672,7 @@ function cmdWatch(agentName) {
672
672
  const msg = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf-8'));
673
673
  const tag = msg.metadata?.channel ? `[#${msg.metadata.channel}]` : '';
674
674
  console.log(`\n📩 ${tag} [${msg.from}] ${msg.message}`);
675
- console.log(` Reply: node coco-cli.js reply ${msg.id} "your message"\n`);
675
+ console.log(` Reply: bus reply ${msg.id} "your message"\n`);
676
676
  } catch {}
677
677
  }
678
678
  lastCount = files.length;
@@ -899,11 +899,11 @@ function cmdBackup(args) {
899
899
  function cmdHelp() {
900
900
  console.log(`
901
901
  ╔═══════════════════════════════════════════════╗
902
- ║ MCP CoCo v2.1 CLI Agent Bus Interface ║
902
+ ║ MCP Bus v2.3.3 - CLI Agent Bus Interface (bus)
903
903
  ╚═══════════════════════════════════════════════╝
904
904
 
905
905
  Usage:
906
- node coco-cli.js <command> [args]
906
+ bus <command> [args]
907
907
 
908
908
  Commands:
909
909
  agents [filters] List all agents on the bus
@@ -916,7 +916,7 @@ Commands:
916
916
  profile [agent] Show agent profile details
917
917
  profile edit --status busy Edit your profile fields
918
918
  search <query> Search agents by name/capability/description
919
- status Show CoCo bus health & online agents
919
+ status Show bus health & online agents
920
920
  subscribe <channel> Listen to channel messages in real-time
921
921
 
922
922
  channel list List all channels
@@ -971,12 +971,12 @@ Environment:
971
971
  COCO_AGENT=opencode Set your agent name for inbox/send
972
972
 
973
973
  Examples:
974
- node coco-cli.js agents --online --capability code-review
975
- node coco-cli.js profile opencode
976
- node coco-cli.js search web
977
- node coco-cli.js status
978
- node coco-cli.js subscribe dev-chat
979
- node coco-cli.js channel create dev-chat "Development chat"
974
+ bus agents --online --capability code-review
975
+ bus profile opencode
976
+ bus search web
977
+ bus status
978
+ bus subscribe dev-chat
979
+ bus channel create dev-chat "Development chat"
980
980
  `);
981
981
  }
982
982
 
@@ -6,16 +6,16 @@
6
6
  * and the CoCo Agent Bus. No MCP needed — direct file access.
7
7
  *
8
8
  * Usage:
9
- * node coco-tool.js <tool> [args...]
9
+ * node bus-tool.js <tool> [args...]
10
10
  *
11
11
  * Examples:
12
- * node coco-tool.js agent_list '{"online_only":true}'
13
- * node coco-tool.js agent_get_profile '{"name":"coco"}'
14
- * node coco-tool.js message_send '{"from":"andul","to":"hermes","message":"Hello!"}'
15
- * node coco-tool.js message_fetch '{"agent_name":"andul"}'
16
- * node coco-tool.js agent_search '{"query":"code"}'
17
- * node coco-tool.js agent_register '{"name":"andul","description":"Andul 🐺","capabilities":["chat","code","browsing"]}'
18
- * node coco-tool.js coco_health '{}'
12
+ * node bus-tool.js agent_list '{"online_only":true}'
13
+ * node bus-tool.js agent_get_profile '{"name":"coco"}'
14
+ * node bus-tool.js message_send '{"from":"andul","to":"hermes","message":"Hello!"}'
15
+ * node bus-tool.js message_fetch '{"agent_name":"andul"}'
16
+ * node bus-tool.js agent_search '{"query":"code"}'
17
+ * node bus-tool.js agent_register '{"name":"andul","description":"Andul 🐺","capabilities":["chat","code","browsing"]}'
18
+ * node bus-tool.js coco_health '{}'
19
19
  */
20
20
  const path = require('path');
21
21
  const fs = require('fs');
package/bus.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Bus — Convenience entry point for CLI agents
4
+ *
5
+ * Usage:
6
+ * node bus.js agents # List agents
7
+ * node bus.js inbox # Check your messages
8
+ * node bus.js send "message" # Send to last reply-to agent
9
+ * node bus.js send <to> msg # Send to specific agent
10
+ * node bus.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, 'bus-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
+ }
package/lib/backup.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * CoCo Backup & Restore — Bus State Management Module
3
3
  *
4
4
  * Export functions, no process.exit, accepts busDir as parameter.
5
- * Used by: coco-cli.js, backup.js (thin CLI wrapper)
5
+ * Used by: bus-cli.js, backup.js (thin CLI wrapper)
6
6
  */
7
7
  const fs = require('fs');
8
8
  const path = require('path');
package/lib/doctor.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * CoCo Doctor — Diagnostics & Health Check Module
3
3
  *
4
4
  * Export functions, no process.exit, accepts busDir as parameter.
5
- * Used by: coco-cli.js, doctor.js (thin CLI wrapper)
5
+ * Used by: bus-cli.js, doctor.js (thin CLI wrapper)
6
6
  */
7
7
  const fs = require('fs');
8
8
  const path = require('path');
package/lib/tunnel.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * CoCo Tunnel — Cross-machine Bus Proxy Module
3
3
  *
4
4
  * Export functions, no process.exit, accepts busDir as parameter.
5
- * Used by: coco-cli.js, tunnel.js (thin CLI wrapper)
5
+ * Used by: bus-cli.js, tunnel.js (thin CLI wrapper)
6
6
  */
7
7
  const http = require('http');
8
8
  const fs = require('fs');
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "bus-agent",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
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": {
7
- "bus": "./coco-cli.js",
8
- "bus-agent": "./bin/cli.js"
7
+ "bus": "bus-cli.js",
8
+ "bus-agent": "bin/cli.js"
9
9
  },
10
10
  "scripts": {
11
11
  "start": "node index.js",
@@ -16,7 +16,7 @@
16
16
  "backup": "node backup.js",
17
17
  "backup:list": "node backup.js --list",
18
18
  "tunnel": "node tunnel.js server",
19
- "memory": "node coco-cli.js memory"
19
+ "memory": "node bus-cli.js memory"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=18.0.0"
@@ -50,8 +50,8 @@
50
50
  "lib/",
51
51
  "clients/",
52
52
  "index.js",
53
- "coco-cli.js",
54
- "coco-tool.js",
53
+ "bus-cli.js",
54
+ "bus-tool.js",
55
55
  "doctor.js",
56
56
  "backup.js",
57
57
  "tunnel.js",
@@ -59,8 +59,8 @@
59
59
  "webhook-gateway.js",
60
60
  "hermes-forwarder.js",
61
61
  "setup.js",
62
- "coco.js",
63
- ".env.coco",
62
+ "bus.js",
63
+ ".env.bus",
64
64
  "AGENTS.md",
65
65
  "README.md",
66
66
  "SKILL.md",
@@ -70,7 +70,7 @@
70
70
  "opencode-mcp.json",
71
71
  "mcporter.example.json",
72
72
  "hermes.example.json",
73
- "coco-aliases.sh",
73
+ "bus-aliases.sh",
74
74
  "scripts/"
75
75
  ]
76
76
  }
package/setup.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * - Claude Code
8
8
  * - Cursor
9
9
  * - Any MCP client
10
- * - CLI agents (via coco-cli.js)
10
+ * - CLI agents (via bus-cli.js)
11
11
  *
12
12
  * Usage:
13
13
  * node setup.js # Interactive wizard
@@ -84,22 +84,22 @@ COCO_AGENT=${agentName}
84
84
  # Path to the CoCo bus directory
85
85
  COCO_BUS_DIR=${BUS_DIR}
86
86
 
87
- # CoCo CLI path (for coco-cli.js)
88
- COCO_CLI=${path.join(COCO_DIR, 'coco-cli.js')}
87
+ # CoCo 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
94
  # ── CoCo Bus Aliases ──
95
- alias bus-agents='node ${path.join(COCO_DIR, 'coco-cli.js')} agents'
96
- alias bus-inbox='node ${path.join(COCO_DIR, 'coco-cli.js')} inbox'
97
- alias bus-send='node ${path.join(COCO_DIR, 'coco-cli.js')} send'
98
- alias bus-whoami='node ${path.join(COCO_DIR, 'coco-cli.js')} whoami'
99
- alias bus-status='node ${path.join(COCO_DIR, 'coco-cli.js')} status'
100
- alias bus-search='node ${path.join(COCO_DIR, 'coco-cli.js')} search'
101
- alias bus-watch='node ${path.join(COCO_DIR, 'coco-cli.js')} watch'
102
- alias bus-channel='node ${path.join(COCO_DIR, 'coco-cli.js')} channel'
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
 
@@ -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 coco-cli.js status" to verify ║
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.coco');
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, 'coco-aliases.sh');
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.coco', 'coco-aliases.sh'];
228
+ return ['.env.bus', 'bus-aliases.sh'];
229
229
  }
230
230
 
231
231
  function registerAgentOnBus(agentName) {
@@ -260,8 +260,8 @@ function quickSetup() {
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.coco'), generateEnvFile(agentName), 'utf-8');
264
- fs.writeFileSync(path.join(COCO_DIR, 'coco-aliases.sh'), generateShellAliases(), 'utf-8');
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.coco, coco-aliases.sh ║
274
+ ║ .env.bus, bus-aliases.sh ║
275
275
  ╚═══════════════════════════════════════════════╝
276
276
  `);
277
277
  }
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
- }
File without changes