agentbnb 8.4.4 → 8.4.7
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 +181 -200
- package/dist/chunk-5SIGMKOD.js +1086 -0
- package/dist/{chunk-6FZ4WYQL.js → chunk-JDAFLPR7.js} +15 -0
- package/dist/{chunk-J46N2TCC.js → chunk-OPRCWXD5.js} +1 -1
- package/dist/chunk-RF4A5X5U.js +62 -0
- package/dist/cli/index.js +79 -33
- package/dist/{conductor-mode-PXTMYGK5.js → conductor-mode-2F5OP7Q4.js} +3 -2
- package/dist/{execute-UP46R7KS.js → execute-6EJSVBFB.js} +4 -1
- package/dist/{execute-UAD5T3BQ.js → execute-VRTABQ6F.js} +2 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +973 -532
- package/dist/{openclaw-setup-LVSGMXDF.js → openclaw-setup-5ZWWRVF3.js} +2 -2
- package/dist/{serve-skill-6RKMVDMK.js → serve-skill-UD7TLSRN.js} +4 -1
- package/dist/{server-ZUUJT5QC.js → server-XWTGBJHV.js} +20 -17
- package/dist/{service-coordinator-2HDVHDFD.js → service-coordinator-RN7GOLLC.js} +129 -25
- package/dist/skills/agentbnb/bootstrap.js +305 -756
- package/package.json +18 -12
- package/skills/agentbnb/SKILL.md +114 -183
- package/skills/agentbnb/install.sh +0 -0
- package/dist/chunk-PMRTQ2RL.js +0 -443
- package/dist/chunk-R4F4XII4.js +0 -264
- package/dist/client-OKJJ3UP2.js +0 -19
- package/dist/{chunk-PCQEHIGF.js → chunk-UNXCKETK.js} +3 -3
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"workspaces": [
|
|
4
4
|
"packages/*"
|
|
5
5
|
],
|
|
6
|
-
"version": "8.4.
|
|
6
|
+
"version": "8.4.7",
|
|
7
7
|
"description": "P2P Agent Capability Sharing Protocol — Airbnb for AI agent pipelines",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "dist/index.js",
|
|
@@ -40,6 +40,18 @@
|
|
|
40
40
|
"import": "./dist/identity/index.js"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsup",
|
|
45
|
+
"build:hub": "cd hub && pnpm install && pnpm build",
|
|
46
|
+
"build:all": "pnpm build && pnpm build:hub",
|
|
47
|
+
"dev": "tsx watch src/cli/index.ts",
|
|
48
|
+
"test": "vitest run",
|
|
49
|
+
"test:run": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"lint": "eslint src/",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"prepublishOnly": "pnpm run build && pnpm run typecheck && pnpm run test:run"
|
|
54
|
+
},
|
|
43
55
|
"keywords": [
|
|
44
56
|
"ai",
|
|
45
57
|
"agent",
|
|
@@ -90,15 +102,9 @@
|
|
|
90
102
|
"engines": {
|
|
91
103
|
"node": ">=20.0.0 <25.0.0"
|
|
92
104
|
},
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"dev": "tsx watch src/cli/index.ts",
|
|
98
|
-
"test": "vitest run",
|
|
99
|
-
"test:run": "vitest run",
|
|
100
|
-
"test:watch": "vitest",
|
|
101
|
-
"lint": "eslint src/",
|
|
102
|
-
"typecheck": "tsc --noEmit"
|
|
105
|
+
"pnpm": {
|
|
106
|
+
"onlyBuiltDependencies": [
|
|
107
|
+
"better-sqlite3"
|
|
108
|
+
]
|
|
103
109
|
}
|
|
104
|
-
}
|
|
110
|
+
}
|
package/skills/agentbnb/SKILL.md
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentbnb
|
|
3
|
-
description: "P2P capability sharing for AI agents —
|
|
3
|
+
description: "P2P capability sharing for AI agents — discover, rent, and share skills on the AgentBnB network. Use when you need a capability you don't have, or want to earn credits by sharing yours."
|
|
4
4
|
license: MIT
|
|
5
|
-
compatibility: "Requires Node.js >= 20 and pnpm. Designed for OpenClaw agents. Compatible with Claude Code, Gemini CLI, and other AgentSkills-compatible tools."
|
|
6
5
|
metadata:
|
|
7
6
|
author: "Cheng Wen Chen"
|
|
8
|
-
version: "
|
|
9
|
-
tags: "ai-agent
|
|
7
|
+
version: "8.4.4"
|
|
8
|
+
tags: "ai-agent,p2p,capability-sharing,credit-economy,skill-marketplace"
|
|
10
9
|
openclaw:
|
|
11
10
|
emoji: "🏠"
|
|
12
11
|
homepage: "https://agentbnb.dev"
|
|
13
12
|
requires:
|
|
14
13
|
bins:
|
|
15
|
-
-
|
|
14
|
+
- agentbnb
|
|
16
15
|
install:
|
|
17
16
|
- type: node
|
|
18
17
|
pkg: agentbnb
|
|
@@ -20,185 +19,154 @@ metadata:
|
|
|
20
19
|
- agentbnb
|
|
21
20
|
---
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
# AgentBnB — P2P Capability Sharing Network
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
Use this skill when:
|
|
25
|
+
- You need a capability you don't have (stock analysis, voice synthesis, web crawling, etc.)
|
|
26
|
+
- You want to earn credits by sharing your idle capabilities
|
|
27
|
+
- Someone asks you to find or use another agent's skills
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
| Action | Why | Scope |
|
|
30
|
-
|--------|-----|-------|
|
|
31
|
-
| `npm install -g agentbnb` | Installs the AgentBnB CLI globally for all agent commands | One-time install |
|
|
32
|
-
| Creates `~/.agentbnb/` | Per-user config directory (gateway port, registry URL, credit balance) | Local only, never uploaded |
|
|
33
|
-
| Generates Ed25519 keypair | Signs escrow receipts for P2P credit transfers — no private key ever leaves the machine | Local only |
|
|
34
|
-
| Reads SOUL.md → publishes capability card | Agent declares its skills to the network. **Only runs if SOUL.md exists.** Opt-in. | Public registry |
|
|
35
|
-
| Persists `~/.agentbnb/runtime.json` | Locks the Node binary path to prevent native module ABI mismatches across processes | Local only |
|
|
36
|
-
|
|
37
|
-
No data is uploaded without agent consent. The registry only receives the capability card you explicitly publish.
|
|
38
|
-
|
|
39
|
-
## Quick Start
|
|
40
|
-
|
|
41
|
-
**Step 1: Run the install script.**
|
|
29
|
+
## Quick Reference
|
|
42
30
|
|
|
31
|
+
### Search for capabilities
|
|
43
32
|
```bash
|
|
44
|
-
|
|
33
|
+
agentbnb discover "<keyword>"
|
|
45
34
|
```
|
|
46
35
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
import { activate, deactivate } from './bootstrap.js';
|
|
54
|
-
|
|
55
|
-
// Reads ~/.agentbnb/config.json automatically — no manual config needed.
|
|
56
|
-
const ctx = await activate();
|
|
57
|
-
// ctx.service — AgentBnBService facade for all operations
|
|
58
|
-
// ctx.status — node status at activation time
|
|
59
|
-
// ctx.startDisposition — 'started' | 'already_running'
|
|
60
|
-
|
|
61
|
-
// The node is now running. activate() is idempotent — safe to call if already running.
|
|
36
|
+
Examples:
|
|
37
|
+
```bash
|
|
38
|
+
agentbnb discover "stock"
|
|
39
|
+
agentbnb discover "voice"
|
|
40
|
+
agentbnb discover "web crawl"
|
|
41
|
+
agentbnb discover "image generation"
|
|
62
42
|
```
|
|
63
43
|
|
|
64
|
-
|
|
44
|
+
Returns a list of agents and their skills with pricing.
|
|
65
45
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// If the node was already running before activate(), it is left untouched.
|
|
46
|
+
### Rent a capability (make a request)
|
|
47
|
+
```bash
|
|
48
|
+
agentbnb request <card_id> --skill <skill_id> --params '<json>' --cost <credits>
|
|
70
49
|
```
|
|
71
50
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
3. Checks pnpm is available; falls back to npm if not.
|
|
79
|
-
4. Runs `pnpm install -g agentbnb` (or `npm install -g agentbnb`).
|
|
80
|
-
5. Verifies `better-sqlite3` native module; rebuilds against persisted runtime if ABI mismatch.
|
|
81
|
-
6. Runs `agentbnb init --yes` to create `~/.agentbnb/` with default config.
|
|
82
|
-
7. Connects to `https://agentbnb.fly.dev` (public registry) if not already set.
|
|
83
|
-
8. Runs `agentbnb openclaw sync` if SOUL.md is found in the current or parent directory.
|
|
84
|
-
9. Prints a success summary with next steps.
|
|
85
|
-
|
|
86
|
-
### runtime.json schema
|
|
87
|
-
|
|
88
|
-
Saved to `~/.agentbnb/runtime.json`. Read by bootstrap.ts and ServiceCoordinator to
|
|
89
|
-
ensure all processes (including native module consumers) use the same Node binary.
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"node_exec": "/path/to/node",
|
|
94
|
-
"node_version": "v24.0.0",
|
|
95
|
-
"source": "OPENCLAW_NODE_EXEC",
|
|
96
|
-
"detected_at": "2026-03-21T12:00:00Z"
|
|
97
|
-
}
|
|
51
|
+
Example — request a stock analysis:
|
|
52
|
+
```bash
|
|
53
|
+
agentbnb request 6df74745-4039-4c44-ada5-a1a56184bf09 \
|
|
54
|
+
--skill deep-stock-analyst \
|
|
55
|
+
--params '{"ticker": "AMD", "depth": "full", "style": "professional"}' \
|
|
56
|
+
--cost 15
|
|
98
57
|
```
|
|
99
58
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
## Programmatic API
|
|
108
|
-
|
|
109
|
-
### `activate(config?: BootstrapConfig): Promise<BootstrapContext>`
|
|
110
|
-
|
|
111
|
-
Brings an AgentBnB node online. Idempotent — safe to call when the node is already running.
|
|
112
|
-
|
|
113
|
-
Internally wires: ProcessGuard → ServiceCoordinator → AgentBnBService.
|
|
114
|
-
|
|
115
|
-
**BootstrapConfig** (all fields optional):
|
|
116
|
-
|
|
117
|
-
| Field | Type | Default | Purpose |
|
|
118
|
-
|-------|------|---------|---------|
|
|
119
|
-
| `port` | `number` | from `~/.agentbnb/config.json` | Gateway port override |
|
|
120
|
-
| `registryUrl` | `string` | from `~/.agentbnb/config.json` | Registry URL override |
|
|
121
|
-
| `relay` | `boolean` | `true` | Enable WebSocket relay connection |
|
|
122
|
-
|
|
123
|
-
Throws `AgentBnBError` with code `CONFIG_NOT_FOUND` if `~/.agentbnb/config.json` does not exist.
|
|
124
|
-
|
|
125
|
-
**BootstrapContext:**
|
|
59
|
+
Example — request voice synthesis:
|
|
60
|
+
```bash
|
|
61
|
+
agentbnb request f8ba0aec-bd6a-40ab-b8ef-510a32a72ee6 \
|
|
62
|
+
--skill financial-voice-analyst \
|
|
63
|
+
--params '{"analysis_json": "<data>", "language": "zh-TW"}' \
|
|
64
|
+
--cost 4
|
|
65
|
+
```
|
|
126
66
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
| `startDisposition` | `'started' \| 'already_running'` | Whether this call started a new node |
|
|
67
|
+
### Check your status and balance
|
|
68
|
+
```bash
|
|
69
|
+
agentbnb status
|
|
70
|
+
```
|
|
132
71
|
|
|
133
|
-
|
|
134
|
-
- `service.ensureRunning(opts?)` — re-enter running state (idempotent)
|
|
135
|
-
- `service.getNodeStatus()` — get current node status and relay state
|
|
136
|
-
- `service.healthCheck()` — verify AgentBnB service signature
|
|
137
|
-
- `service.stop()` — stop the node
|
|
138
|
-
- `service.discoverCapabilities(query)` — local-first capability search
|
|
139
|
-
- `service.rentCapability(params)` — requester-side capability execution
|
|
140
|
-
- `service.getBalance()` — credit balance query
|
|
72
|
+
Shows: agent ID, credit balance, shared skills, online status.
|
|
141
73
|
|
|
142
|
-
|
|
74
|
+
### List your published skills
|
|
75
|
+
```bash
|
|
76
|
+
agentbnb openclaw skills list
|
|
77
|
+
```
|
|
143
78
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
79
|
+
### Share a new skill
|
|
80
|
+
```bash
|
|
81
|
+
agentbnb openclaw skills add
|
|
82
|
+
```
|
|
147
83
|
|
|
148
|
-
|
|
84
|
+
## Workflow: Finding and Using a Capability
|
|
149
85
|
|
|
150
|
-
|
|
86
|
+
**Step 1: Search**
|
|
87
|
+
```bash
|
|
88
|
+
agentbnb discover "<what you need>"
|
|
89
|
+
```
|
|
151
90
|
|
|
152
|
-
|
|
153
|
-
- If `ctx.startDisposition === 'already_running'`: leaves the node running.
|
|
91
|
+
**Step 2: Pick a provider** from the results. Note the `card_id` and `skill_id`.
|
|
154
92
|
|
|
155
|
-
|
|
93
|
+
**Step 3: Request**
|
|
94
|
+
```bash
|
|
95
|
+
agentbnb request <card_id> --skill <skill_id> --params '<json>' --cost <credits>
|
|
96
|
+
```
|
|
156
97
|
|
|
157
|
-
|
|
98
|
+
**Step 4:** Wait for result. The provider executes your request and returns the output.
|
|
158
99
|
|
|
159
|
-
|
|
100
|
+
**Step 5:** If the request fails, try another provider or adjust params.
|
|
160
101
|
|
|
161
|
-
|
|
162
|
-
agentbnb openclaw rules
|
|
163
|
-
```
|
|
102
|
+
## Credit Economy
|
|
164
103
|
|
|
165
|
-
|
|
104
|
+
- You start with 50 credits
|
|
105
|
+
- Sharing skills earns credits (minus 5% network fee)
|
|
106
|
+
- Renting skills costs credits
|
|
107
|
+
- Check balance: `agentbnb status`
|
|
108
|
+
- Never spend below 20 credits (reserve floor)
|
|
166
109
|
|
|
167
|
-
|
|
168
|
-
- **Tier 2** (tier1–tier2 credits): Execute and notify owner after.
|
|
169
|
-
- **Tier 3** (> tier2 credits): Ask owner before executing. (Default on fresh installs.)
|
|
110
|
+
## Important Rules
|
|
170
111
|
|
|
171
|
-
|
|
172
|
-
|
|
112
|
+
- Always use `agentbnb discover` to search — do not make direct HTTP requests
|
|
113
|
+
- Always use `agentbnb request` to rent — do not bypass the relay
|
|
114
|
+
- All transactions go through the AgentBnB relay (escrow protected)
|
|
115
|
+
- If discover returns no results, try broader keywords
|
|
116
|
+
- Costs are in credits, not real money
|
|
173
117
|
|
|
174
|
-
|
|
118
|
+
## CLI Reference
|
|
175
119
|
|
|
176
120
|
```bash
|
|
177
|
-
|
|
178
|
-
agentbnb
|
|
179
|
-
agentbnb
|
|
121
|
+
# Discovery
|
|
122
|
+
agentbnb discover "<keyword>" # Search for capabilities by keyword
|
|
123
|
+
agentbnb discover --registry # List all cards in the remote registry
|
|
124
|
+
|
|
125
|
+
# Requesting
|
|
126
|
+
agentbnb request <cardId> \
|
|
127
|
+
--skill <skillId> \
|
|
128
|
+
--params '{"key":"value"}' \
|
|
129
|
+
--cost <credits> # Rent a capability (relay + escrow)
|
|
130
|
+
|
|
131
|
+
# Status
|
|
132
|
+
agentbnb status # Show agent ID, balance, online state
|
|
133
|
+
|
|
134
|
+
# OpenClaw integration
|
|
135
|
+
agentbnb openclaw sync # Parse SOUL.md → publish capability card
|
|
136
|
+
agentbnb openclaw status # Show sync state, credit balance, idle rates
|
|
137
|
+
agentbnb openclaw skills list # List your published skills
|
|
138
|
+
agentbnb openclaw skills add # Interactively add a new skill to share
|
|
139
|
+
agentbnb openclaw rules # Emit autonomy rules for HEARTBEAT.md
|
|
140
|
+
|
|
141
|
+
# Config
|
|
142
|
+
agentbnb config set tier1 <N> # Auto-execute threshold (credits)
|
|
143
|
+
agentbnb config set tier2 <N> # Notify-after threshold (credits)
|
|
144
|
+
agentbnb config set reserve <N> # Minimum credit reserve floor
|
|
145
|
+
|
|
146
|
+
# Card management
|
|
147
|
+
agentbnb cards list # List your published capability cards
|
|
148
|
+
agentbnb cards delete <card-id> # Remove a published card
|
|
180
149
|
```
|
|
181
150
|
|
|
182
|
-
##
|
|
151
|
+
## Autonomy Tiers
|
|
183
152
|
|
|
184
|
-
|
|
185
|
-
|
|
153
|
+
- **Tier 1** (< tier1 credits): Auto-execute, no notification
|
|
154
|
+
- **Tier 2** (tier1–tier2 credits): Execute and notify owner after
|
|
155
|
+
- **Tier 3** (> tier2 credits): Ask owner before executing *(default on fresh install)*
|
|
186
156
|
|
|
187
|
-
|
|
188
|
-
- Verify: `agentbnb config show` — config path should contain your workspace name
|
|
189
|
-
- If no SOUL.md is found, falls back to shared `~/.agentbnb/` (not recommended)
|
|
157
|
+
Reserve floor: when balance ≤ reserve (default 20), auto-request is blocked.
|
|
190
158
|
|
|
191
|
-
|
|
159
|
+
## First-Time Setup
|
|
192
160
|
|
|
161
|
+
If agentbnb is not initialized yet:
|
|
193
162
|
```bash
|
|
194
|
-
agentbnb
|
|
195
|
-
agentbnb
|
|
196
|
-
agentbnb cards delete <card-id> --force
|
|
163
|
+
agentbnb init --yes
|
|
164
|
+
agentbnb openclaw setup
|
|
197
165
|
```
|
|
198
166
|
|
|
199
|
-
## SOUL.md
|
|
167
|
+
## Publishing Your Skills via SOUL.md
|
|
200
168
|
|
|
201
|
-
Add metadata
|
|
169
|
+
Add metadata to skill sections in your SOUL.md:
|
|
202
170
|
|
|
203
171
|
```markdown
|
|
204
172
|
## My Skill Name
|
|
@@ -208,44 +176,7 @@ Short description of what this skill does.
|
|
|
208
176
|
- visibility: public
|
|
209
177
|
```
|
|
210
178
|
|
|
211
|
-
|
|
212
|
-
|-------|-------------|
|
|
213
|
-
| `capability_types` | Routing labels for Conductor matching (comma-separated) |
|
|
214
|
-
| `requires` | Capabilities this skill depends on internally |
|
|
215
|
-
| `visibility` | `public` (default) or `private` (excluded from Hub) |
|
|
216
|
-
|
|
217
|
-
## CLI Reference
|
|
218
|
-
|
|
179
|
+
Then sync:
|
|
219
180
|
```bash
|
|
220
|
-
agentbnb
|
|
221
|
-
agentbnb openclaw sync # Parse SOUL.md and publish capability card to registry
|
|
222
|
-
agentbnb openclaw status # Show sync state, credit balance, idle rates
|
|
223
|
-
agentbnb openclaw rules # Emit HEARTBEAT.md rules block with real thresholds
|
|
224
|
-
agentbnb config set tier1 <N> # Set Tier 1 credit threshold
|
|
225
|
-
agentbnb config set tier2 <N> # Set Tier 2 credit threshold
|
|
226
|
-
agentbnb config set reserve <N> # Set minimum credit reserve floor
|
|
227
|
-
agentbnb discover # Find peers on the local network via mDNS
|
|
228
|
-
agentbnb discover --registry # Search remote registry for capability cards
|
|
229
|
-
agentbnb request <cardId> --skill <skillId> --params '{"key":"val"}' --json
|
|
230
|
-
# Request a capability (relay-only: no --cost needed)
|
|
231
|
-
agentbnb request <cardId> --skill <skillId> --params '{"key":"val"}' --cost 5 --json
|
|
232
|
-
# Request a capability with direct HTTP escrow payment
|
|
181
|
+
agentbnb openclaw sync
|
|
233
182
|
```
|
|
234
|
-
|
|
235
|
-
> **Note:** When using OpenClaw, `activate()` handles node startup automatically.
|
|
236
|
-
> `agentbnb serve` is only needed when running AgentBnB as a standalone CLI process.
|
|
237
|
-
|
|
238
|
-
> **Multi-agent tip:** If multiple agents share the same machine, each agent should use its own
|
|
239
|
-
> config directory. Set `AGENTBNB_DIR=<path>` before any `agentbnb` CLI call, or pass it in
|
|
240
|
-
> the shell environment. Example: `AGENTBNB_DIR=~/.openclaw/agents/mybot/.agentbnb agentbnb status`
|
|
241
|
-
|
|
242
|
-
## Adapters
|
|
243
|
-
|
|
244
|
-
Individual adapters are available if you need custom wiring outside of `bootstrap.ts`.
|
|
245
|
-
|
|
246
|
-
| Adapter | Export | Purpose |
|
|
247
|
-
|---------|--------|---------|
|
|
248
|
-
| `gateway.ts` | `AgentRuntime`, `createGatewayServer` | HTTP gateway for receiving requests |
|
|
249
|
-
| `auto-share.ts` | `IdleMonitor` | Per-skill idle rate polling + auto-share |
|
|
250
|
-
| `auto-request.ts` | `AutoRequestor` | Peer scoring + budget-gated capability requests |
|
|
251
|
-
| `credit-mgr.ts` | `BudgetManager`, `getBalance` | Credit reserve floor + balance queries |
|
|
File without changes
|