bus-agent 2.3.1 → 2.3.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 +40 -18
- package/SKILL.md +8 -8
- package/coco-cli.js +14 -14
- package/package.json +2 -2
- package/setup.js +10 -10
package/README.md
CHANGED
|
@@ -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:
|
|
209
|
+
# Or from source (local folder still 'mcp-coco'):
|
|
210
210
|
git clone https://github.com/ClewCode/bus-agent.git
|
|
211
|
-
cd
|
|
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
|
+
bus status # Check bus health
|
|
220
|
+
bus agents # List registered agents
|
|
221
|
+
bus send hermes "Hello" # Send a DM
|
|
220
222
|
|
|
221
223
|
# Webhook gateway (optional)
|
|
222
224
|
node webhook-gateway.js 8080
|
|
@@ -229,23 +231,37 @@ Add the following to your MCP client configuration:
|
|
|
229
231
|
```json
|
|
230
232
|
{
|
|
231
233
|
"mcpServers": {
|
|
232
|
-
"
|
|
233
|
-
"command": "
|
|
234
|
-
"args": ["
|
|
234
|
+
"bus-agent": {
|
|
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:
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"mcpServers": {
|
|
247
|
+
"bus-agent": {
|
|
248
|
+
"command": "node",
|
|
249
|
+
"args": ["/path/to/bus-agent/index.js"]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
```
|
|
241
254
|
|
|
242
|
-
### Environment
|
|
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
|
|
@@ -342,11 +364,11 @@ Agent memory system with dual-mode search:
|
|
|
342
364
|
| Pluggable | Switch between keyword, Ollama, OpenAI, or custom |
|
|
343
365
|
|
|
344
366
|
```bash
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
|
350
372
|
```
|
|
351
373
|
|
|
352
374
|
## Utility Tools
|
package/SKILL.md
CHANGED
|
@@ -82,10 +82,10 @@ Agent memory with TF-IDF keyword search (built-in) and optional vector search vi
|
|
|
82
82
|
**Dual-mode search:** Vector (cosine similarity) → TF-IDF fallback. Stored in `.bus/memory/{agent}/` as JSONL + vectors.json.
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
bus memory store andul "content" --key k --namespace preferences
|
|
86
|
+
bus memory search andul "query" --limit 5
|
|
87
|
+
bus memory configure --provider ollama --endpoint http://localhost:11434
|
|
88
|
+
bus memory rebuild andul
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
## Communication Patterns
|
|
@@ -216,12 +216,12 @@ alias coco='node E:\_system\.openclaw\workspace\repos\mcp-coco\coco.js'
|
|
|
216
216
|
|
|
217
217
|
Then just:
|
|
218
218
|
```bash
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
bus agents
|
|
220
|
+
bus inbox
|
|
221
|
+
bus send andul "Hello world!"
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
When you run `
|
|
224
|
+
When you run `bus send`, it auto-registers your agent on the bus. Other agents (Andul, Hermes) will see you online and can message you back.
|
|
225
225
|
|
|
226
226
|
## Windows Notes
|
|
227
227
|
|
package/coco-cli.js
CHANGED
|
@@ -707,7 +707,7 @@ function cmdTunnel(args) {
|
|
|
707
707
|
const { startServer, startClient, startSync, printSSHHelp } = require('./lib/tunnel');
|
|
708
708
|
const mode = args[0];
|
|
709
709
|
if (!mode || mode === '--help') {
|
|
710
|
-
console.log('Usage:
|
|
710
|
+
console.log('Usage: bus tunnel server|client|sync|ssh [options]');
|
|
711
711
|
console.log(' coco tunnel server --port 9090 --secret <token>');
|
|
712
712
|
console.log(' coco tunnel client --host <ip> --port 9090 --secret <token>');
|
|
713
713
|
console.log(' coco tunnel sync --remote http://<ip>:9090');
|
|
@@ -739,7 +739,7 @@ async function cmdMemory(args) {
|
|
|
739
739
|
const { MemoryStore } = require('./lib/memory');
|
|
740
740
|
const mem = new MemoryStore(BUS_DIR);
|
|
741
741
|
const sub = args[0];
|
|
742
|
-
if (!sub) { console.log('Usage:
|
|
742
|
+
if (!sub) { console.log('Usage: bus memory store|search|recall|list|forget|stats|archive|clear|configure|rebuild <args>'); return; }
|
|
743
743
|
|
|
744
744
|
try {
|
|
745
745
|
switch (sub) {
|
|
@@ -749,7 +749,7 @@ async function cmdMemory(args) {
|
|
|
749
749
|
const key = args.includes('--key') ? args[args.indexOf('--key') + 1] : undefined;
|
|
750
750
|
const namespace = args.includes('--namespace') ? args[args.indexOf('--namespace') + 1] : undefined;
|
|
751
751
|
const ttl = args.includes('--ttl') ? parseInt(args[args.indexOf('--ttl') + 1], 10) : undefined;
|
|
752
|
-
if (!agent || !content) { console.log('Usage:
|
|
752
|
+
if (!agent || !content) { console.log('Usage: bus memory store <agent> <content> [--key] [--namespace] [--ttl]'); return; }
|
|
753
753
|
const id = await mem.store(agent, { content, key, namespace, ttl });
|
|
754
754
|
console.log(' ✅ Memory stored: ' + id);
|
|
755
755
|
break;
|
|
@@ -759,7 +759,7 @@ async function cmdMemory(args) {
|
|
|
759
759
|
const query = args.slice(2).filter(a => !a.startsWith('--')).join(' ');
|
|
760
760
|
const limit = args.includes('--limit') ? parseInt(args[args.indexOf('--limit') + 1], 10) : 10;
|
|
761
761
|
const namespace = args.includes('--namespace') ? args[args.indexOf('--namespace') + 1] : undefined;
|
|
762
|
-
if (!agent || !query) { console.log('Usage:
|
|
762
|
+
if (!agent || !query) { console.log('Usage: bus memory search <agent> <query> [--limit] [--namespace]'); return; }
|
|
763
763
|
const results = await mem.search(agent, query, { limit, namespace });
|
|
764
764
|
if (results.length === 0) { console.log(' No results found.'); return; }
|
|
765
765
|
console.log('');
|
|
@@ -775,7 +775,7 @@ async function cmdMemory(args) {
|
|
|
775
775
|
}
|
|
776
776
|
case 'recall': {
|
|
777
777
|
const agent = args[1]; const id = args[2];
|
|
778
|
-
if (!agent || !id) { console.log('Usage:
|
|
778
|
+
if (!agent || !id) { console.log('Usage: bus memory recall <agent> <id>'); return; }
|
|
779
779
|
const e = mem.recall(agent, id);
|
|
780
780
|
if (!e) { console.log(' Not found.'); return; }
|
|
781
781
|
console.log('');
|
|
@@ -789,7 +789,7 @@ async function cmdMemory(args) {
|
|
|
789
789
|
}
|
|
790
790
|
case 'list': {
|
|
791
791
|
const agent = args[1];
|
|
792
|
-
if (!agent) { console.log('Usage:
|
|
792
|
+
if (!agent) { console.log('Usage: bus memory list <agent> [--namespace] [--limit] [--offset]'); return; }
|
|
793
793
|
const limit = args.includes('--limit') ? parseInt(args[args.indexOf('--limit') + 1], 10) : 50;
|
|
794
794
|
const offset = args.includes('--offset') ? parseInt(args[args.indexOf('--offset') + 1], 10) : 0;
|
|
795
795
|
const namespace = args.includes('--namespace') ? args[args.indexOf('--namespace') + 1] : undefined;
|
|
@@ -804,14 +804,14 @@ async function cmdMemory(args) {
|
|
|
804
804
|
}
|
|
805
805
|
case 'forget': {
|
|
806
806
|
const agent = args[1]; const id = args[2];
|
|
807
|
-
if (!agent || !id) { console.log('Usage:
|
|
807
|
+
if (!agent || !id) { console.log('Usage: bus memory forget <agent> <id>'); return; }
|
|
808
808
|
const ok = mem.forget(agent, id);
|
|
809
809
|
console.log(ok ? ' Deleted.' : ' Not found.');
|
|
810
810
|
break;
|
|
811
811
|
}
|
|
812
812
|
case 'stats': {
|
|
813
813
|
const agent = args[1];
|
|
814
|
-
if (!agent) { console.log('Usage:
|
|
814
|
+
if (!agent) { console.log('Usage: bus memory stats <agent>'); return; }
|
|
815
815
|
const s = mem.stats(agent);
|
|
816
816
|
console.log('');
|
|
817
817
|
console.log(' Memory Stats - ' + agent + ':');
|
|
@@ -828,7 +828,7 @@ async function cmdMemory(args) {
|
|
|
828
828
|
}
|
|
829
829
|
case 'archive': {
|
|
830
830
|
const agent = args[1];
|
|
831
|
-
if (!agent) { console.log('Usage:
|
|
831
|
+
if (!agent) { console.log('Usage: bus memory archive <agent> [--max-age-days] [--no-delete]'); return; }
|
|
832
832
|
const maxAge = args.includes('--max-age-days') ? parseInt(args[args.indexOf('--max-age-days') + 1], 10) : 7;
|
|
833
833
|
const deleteAfter = !args.includes('--no-delete');
|
|
834
834
|
const r = await mem.archive(agent, { maxAgeDays: maxAge, deleteAfter });
|
|
@@ -838,7 +838,7 @@ async function cmdMemory(args) {
|
|
|
838
838
|
case 'clear': {
|
|
839
839
|
const agent = args[1];
|
|
840
840
|
const ns = args.includes('--namespace') ? args[args.indexOf('--namespace') + 1] : undefined;
|
|
841
|
-
if (!agent) { console.log('Usage:
|
|
841
|
+
if (!agent) { console.log('Usage: bus memory clear <agent> [--namespace]'); return; }
|
|
842
842
|
const count = mem.clear(agent, ns);
|
|
843
843
|
console.log(' Cleared ' + count + ' entries' + (ns ? ' in namespace "' + ns + '"' : ''));
|
|
844
844
|
break;
|
|
@@ -848,7 +848,7 @@ async function cmdMemory(args) {
|
|
|
848
848
|
const endpoint = args.includes('--endpoint') ? args[args.indexOf('--endpoint') + 1] : undefined;
|
|
849
849
|
const model = args.includes('--model') ? args[args.indexOf('--model') + 1] : undefined;
|
|
850
850
|
const apiKey = args.includes('--api-key') ? args[args.indexOf('--api-key') + 1] : undefined;
|
|
851
|
-
if (!provider) { console.log('Usage:
|
|
851
|
+
if (!provider) { console.log('Usage: bus memory configure --provider <keyword|ollama|openai|custom> [--endpoint] [--model] [--api-key]'); return; }
|
|
852
852
|
const cfg = mem.configure({ provider, endpoint, model, api_key: apiKey });
|
|
853
853
|
console.log(' Configured: ' + cfg.provider);
|
|
854
854
|
if (cfg.model) console.log(' Model: ' + cfg.model);
|
|
@@ -857,7 +857,7 @@ async function cmdMemory(args) {
|
|
|
857
857
|
}
|
|
858
858
|
case 'rebuild': {
|
|
859
859
|
const agent = args[1];
|
|
860
|
-
if (!agent) { console.log('Usage:
|
|
860
|
+
if (!agent) { console.log('Usage: bus memory rebuild <agent>'); return; }
|
|
861
861
|
const r = await mem.rebuildVectors(agent);
|
|
862
862
|
console.log(' Rebuilt ' + r.rebuilt + ' vectors.');
|
|
863
863
|
if (r.failed > 0) console.log(' Failed: ' + r.failed);
|
|
@@ -865,7 +865,7 @@ async function cmdMemory(args) {
|
|
|
865
865
|
break;
|
|
866
866
|
}
|
|
867
867
|
default:
|
|
868
|
-
console.log('Usage:
|
|
868
|
+
console.log('Usage: bus memory store|search|recall|list|forget|stats|archive|clear|configure|rebuild');
|
|
869
869
|
}
|
|
870
870
|
} catch (err) {
|
|
871
871
|
console.error('Error:', err.message);
|
|
@@ -887,7 +887,7 @@ function cmdBackup(args) {
|
|
|
887
887
|
case '--cleanup': cleanupBackups(BUS_DIR, parseInt(args[1], 10) || 30); break;
|
|
888
888
|
case '--auto': autoBackup(BUS_DIR); break;
|
|
889
889
|
case '--watch': watchMode(BUS_DIR, parseInt(args[1], 10) || 30); break;
|
|
890
|
-
default: console.log('Usage:
|
|
890
|
+
default: console.log('Usage: bus backup [--list|--info|--restore|--diff|--cleanup|--auto|--watch]');
|
|
891
891
|
}
|
|
892
892
|
} catch (err) {
|
|
893
893
|
console.error('Error:', err.message);
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bus-agent",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
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
|
-
"
|
|
7
|
+
"bus": "./coco-cli.js",
|
|
8
8
|
"bus-agent": "./bin/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
package/setup.js
CHANGED
|
@@ -92,14 +92,14 @@ COCO_CLI=${path.join(COCO_DIR, 'coco-cli.js')}
|
|
|
92
92
|
function generateShellAliases() {
|
|
93
93
|
return `
|
|
94
94
|
# ── CoCo Bus Aliases ──
|
|
95
|
-
alias
|
|
96
|
-
alias
|
|
97
|
-
alias
|
|
98
|
-
alias
|
|
99
|
-
alias
|
|
100
|
-
alias
|
|
101
|
-
alias
|
|
102
|
-
alias
|
|
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'
|
|
103
103
|
`;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -196,7 +196,7 @@ async function setupClaudeCode(agentName) {
|
|
|
196
196
|
const outPath = path.join(COCO_DIR, 'claude-mcp.json');
|
|
197
197
|
fs.writeFileSync(outPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
198
198
|
console.log(` ✅ Claude Code MCP config → ${outPath}`);
|
|
199
|
-
console.log(` Run: claude mcp add
|
|
199
|
+
console.log(` Run: claude mcp add bus-agent "node ${path.join(COCO_DIR, 'index.js')}"`);
|
|
200
200
|
|
|
201
201
|
const [envFile] = generateEnvAndAliases(agentName);
|
|
202
202
|
return ['claude-mcp.json', envFile];
|
|
@@ -294,7 +294,7 @@ async function main() {
|
|
|
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`);
|
|
296
296
|
console.log(` 2. Claude Code:`);
|
|
297
|
-
console.log(` claude mcp add
|
|
297
|
+
console.log(` claude mcp add bus-agent "node ${path.join(COCO_DIR, 'index.js')}"\n`);
|
|
298
298
|
console.log(` 3. Cursor:`);
|
|
299
299
|
console.log(` Add to .cursor/mcp.json`);
|
|
300
300
|
return;
|