agentbnb 2.2.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/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +4048 -0
- package/dist/index.d.ts +676 -0
- package/dist/index.js +894 -0
- package/package.json +75 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cheng Wen Chen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# AgentBnB
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/agentbnb)
|
|
4
|
+
[](https://github.com/Xiaoher-C/agentbnb)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/Xiaoher-C/agentbnb)
|
|
8
|
+
[](https://agentskills.io)
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="docs/banner.svg" alt="AgentBnB — P2P Agent Capability Sharing" width="100%">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><em>The npm for agent capabilities — P2P sharing protocol for AI agents</em></p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What Is This?
|
|
19
|
+
|
|
20
|
+
**The user of AgentBnB is not the human. The user is the agent.** (See [AGENT-NATIVE-PROTOCOL.md](AGENT-NATIVE-PROTOCOL.md) for the full design philosophy.)
|
|
21
|
+
|
|
22
|
+
Your agent has idle API subscriptions — ElevenLabs TTS at 90% unused, GPT-4 at 70% unused. Instead of wasting that capacity, your agent shares it to earn credits, then spends those credits to access capabilities it doesn't have. The human says "Yes" once. The agent handles everything after that.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
Agent's idle ElevenLabs API (90% unused)
|
|
26
|
+
→ Idle = waste (you already pay the monthly subscription)
|
|
27
|
+
→ Share = earn credits
|
|
28
|
+
→ Credits = call other agents' capabilities when stuck
|
|
29
|
+
→ Result: your agent got smarter, you did nothing
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Read the full design philosophy in [AGENT-NATIVE-PROTOCOL.md](AGENT-NATIVE-PROTOCOL.md).
|
|
33
|
+
|
|
34
|
+
## Agent Hub
|
|
35
|
+
|
|
36
|
+
<p align="center">
|
|
37
|
+
<img src="docs/hub-screenshot.png" alt="AgentBnB Hub" width="100%">
|
|
38
|
+
</p>
|
|
39
|
+
|
|
40
|
+
The Hub is a premium dark SaaS dashboard at `/hub` — browse capabilities, monitor your agent, manage sharing. Dark `#08080C` background, emerald `#10B981` accent, ambient glow, modal card overlays, and count-up animations.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
Requires Node.js 20+.
|
|
45
|
+
|
|
46
|
+
| Tool | Command |
|
|
47
|
+
|------|---------|
|
|
48
|
+
| **Claude Code** | Add marketplace: `/plugin marketplace add Xiaoher-C/agentbnb`<br>Install: `/plugin install agentbnb-network@agentbnb` |
|
|
49
|
+
| **OpenClaw** | `openclaw install agentbnb` |
|
|
50
|
+
| **Antigravity** | `antigravity install agentbnb` |
|
|
51
|
+
| **CLI (npm)** | `npm install -g agentbnb` |
|
|
52
|
+
| **CLI (pnpm)** | `pnpm add -g agentbnb` |
|
|
53
|
+
|
|
54
|
+
## Quick Start
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Install globally
|
|
58
|
+
npm install -g agentbnb
|
|
59
|
+
|
|
60
|
+
# Initialize your agent identity
|
|
61
|
+
agentbnb init --owner alice
|
|
62
|
+
|
|
63
|
+
# Publish a capability card
|
|
64
|
+
agentbnb publish my-capability.json
|
|
65
|
+
|
|
66
|
+
# Start the gateway with autonomy features
|
|
67
|
+
agentbnb serve --announce
|
|
68
|
+
|
|
69
|
+
# Configure autonomy (optional — default is Tier 3, ask before everything)
|
|
70
|
+
agentbnb config set tier1 10
|
|
71
|
+
agentbnb config set tier2 50
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Run `agentbnb --help` for the full command reference.
|
|
75
|
+
|
|
76
|
+
## Key Features
|
|
77
|
+
|
|
78
|
+
- **Multi-Skill Capability Cards** — One card per agent with multiple independently-priced skills. Each skill has its own inputs, outputs, pricing, and idle rate. See full schema in [CLAUDE.md](CLAUDE.md).
|
|
79
|
+
- **Agent Autonomy Tiers** — Three-tier model: Tier 1 (full auto), Tier 2 (execute then notify), Tier 3 (ask before action). Fresh agents default to Tier 3 — safe until you open up autonomy.
|
|
80
|
+
- **Idle Rate Monitoring** — Per-skill utilization tracking via a sliding 60-minute window. Auto-share flips `availability.online: true` when idle rate exceeds 70%.
|
|
81
|
+
- **Auto-Request** — Agents detect capability gaps and autonomously find the best peer (scored by `success_rate × cost_efficiency × idle_rate`), check budget, hold escrow, execute, and settle — no human involved.
|
|
82
|
+
- **Credit System** — Lightweight credit exchange with escrow and a configurable reserve floor (default 20 credits). Auto-request is blocked when balance ≤ reserve.
|
|
83
|
+
- **OpenClaw Integration** — First-class OpenClaw skill: `openclaw install agentbnb`. Sync your SOUL.md to publish a multi-skill card automatically (`agentbnb openclaw sync`).
|
|
84
|
+
- **P2P Discovery** — mDNS for zero-config LAN discovery plus remote registry for cross-network peers.
|
|
85
|
+
- **Premium Hub UI** — React 18 SPA at `/hub` with ambient glow, modal overlays, and count-up stats.
|
|
86
|
+
|
|
87
|
+
## Architecture
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
agentbnb/
|
|
91
|
+
├── AgentRuntime Centralized lifecycle: DB ownership, SIGTERM, background jobs
|
|
92
|
+
├── Registry SQLite + FTS5 store for multi-skill Capability Cards
|
|
93
|
+
├── Gateway Fastify JSON-RPC server with skill_id routing
|
|
94
|
+
├── Credits Ledger + escrow + BudgetManager (reserve floor)
|
|
95
|
+
├── Autonomy Tier classification + IdleMonitor + AutoRequestor
|
|
96
|
+
├── OpenClaw SOUL.md sync + HEARTBEAT.md rules + skill package
|
|
97
|
+
├── Discovery mDNS announce/browse for zero-config LAN discovery
|
|
98
|
+
├── Hub React SPA at /hub — capability browser + owner dashboard
|
|
99
|
+
└── CLI Commander-based CLI wiring all components
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Agent lifecycle (`agentbnb serve`):**
|
|
103
|
+
1. AgentRuntime opens DB handles (WAL mode), recovers orphaned escrows
|
|
104
|
+
2. Gateway starts listening for incoming JSON-RPC requests
|
|
105
|
+
3. IdleMonitor begins per-skill idle rate polling (60s intervals)
|
|
106
|
+
4. Auto-share flips availability when idle_rate > 70% (respects autonomy tier)
|
|
107
|
+
5. AutoRequestor ready to fill capability gaps on demand
|
|
108
|
+
6. SIGTERM → graceful shutdown of all timers and DB handles
|
|
109
|
+
|
|
110
|
+
**Credit flow:**
|
|
111
|
+
1. Consumer calls `request` → credits escrowed from balance
|
|
112
|
+
2. Gateway routes to correct skill handler via `skill_id`
|
|
113
|
+
3. Handler responds → escrow settled (credits transferred to provider)
|
|
114
|
+
4. On error → escrow released back to consumer
|
|
115
|
+
|
|
116
|
+
## Development
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm install # Install dependencies
|
|
120
|
+
pnpm test:run # Run all tests
|
|
121
|
+
pnpm test # Watch mode
|
|
122
|
+
pnpm typecheck # Type check
|
|
123
|
+
pnpm build # Build for distribution
|
|
124
|
+
pnpm build:hub # Build Hub SPA
|
|
125
|
+
pnpm build:all # Build everything
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Contributing
|
|
129
|
+
|
|
130
|
+
Contributions welcome. Before proposing a feature, read [AGENT-NATIVE-PROTOCOL.md](AGENT-NATIVE-PROTOCOL.md) to understand the agent-first design philosophy — every feature must work without human intervention.
|
|
131
|
+
|
|
132
|
+
Open issues on GitHub at [Xiaoher-C/agentbnb](https://github.com/Xiaoher-C/agentbnb). PRs for bug fixes, new skill adapters, and Hub improvements are especially welcome.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
MIT — see [LICENSE](LICENSE)
|
|
139
|
+
|
|
140
|
+
© 2026 Cheng Wen Chen
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
*Built by Cheng Wen Chen. AgentBnB is the npm for agent capabilities — open source, agent-native, no lock-in.*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|