agentbnb 6.0.0 → 7.0.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/README.md +245 -39
- package/dist/{card-REW7BSWW.js → card-EX2EYGCZ.js} +1 -1
- package/dist/{chunk-C6KPAFCC.js → chunk-3LWBH7P3.js} +94 -3
- package/dist/{chunk-YRRVFTDR.js → chunk-5AAFG2V2.js} +3 -3
- package/dist/{chunk-C2T4BMRW.js → chunk-5GME4KJZ.js} +8 -6
- package/dist/{chunk-VPQ44XKE.js → chunk-64AK4FJM.js} +2 -2
- package/dist/{chunk-2TLZ6G2B.js → chunk-7EF3HYVZ.js} +158 -18
- package/dist/{chunk-JR6TJDIF.js → chunk-ALX4WS3A.js} +9 -4
- package/dist/{chunk-7XHDSWRD.js → chunk-B2VJTKO5.js} +2 -2
- package/dist/{chunk-TR6UZDNX.js → chunk-C537SFHV.js} +8 -6
- package/dist/{chunk-F53QQIM2.js → chunk-CUONY5TO.js} +1 -1
- package/dist/chunk-D6RKW2XG.js +395 -0
- package/dist/{chunk-NYV3NE5Z.js → chunk-E2OKP5CY.js} +4 -4
- package/dist/{chunk-TQDV254A.js → chunk-FTZTEHYG.js} +117 -117
- package/dist/{chunk-Y7T6IMM3.js → chunk-GKVTD4EZ.js} +1 -1
- package/dist/{chunk-VMH2YS2I.js → chunk-KF3TZHA5.js} +1 -1
- package/dist/{chunk-574W3HHE.js → chunk-LJM7FHPM.js} +1 -1
- package/dist/chunk-NWIQJ2CL.js +108 -0
- package/dist/{chunk-KA2VIEGM.js → chunk-O2OYBAVR.js} +1 -1
- package/dist/{chunk-NQTE577Q.js → chunk-OCSU2S6W.js} +9 -0
- package/dist/{chunk-PSQHUZ7X.js → chunk-OH7BP5NP.js} +1 -1
- package/dist/chunk-SSK653A6.js +169 -0
- package/dist/{chunk-BP3L2TET.js → chunk-TBJ3FZKZ.js} +2 -2
- package/dist/{chunk-3CIMVISQ.js → chunk-WVY2W7AA.js} +4 -0
- package/dist/{chunk-OZXCRLP3.js → chunk-X32NE6V4.js} +5 -2
- package/dist/{chunk-7YLFLC5C.js → chunk-YHY7OG6S.js} +5 -5
- package/dist/{chunk-JOY533UH.js → chunk-Z4MCGKTL.js} +6 -2
- package/dist/cli/index.js +530 -269
- package/dist/{client-HRYRJKSA.js → client-HKV3QWZ3.js} +3 -3
- package/dist/{conduct-LF6FYPLD.js → conduct-W6XF6DJW.js} +14 -13
- package/dist/conduct-YB64OHI6.js +22 -0
- package/dist/{conductor-mode-NUDQLZFM.js → conductor-mode-2GSLHVN6.js} +7 -4
- package/dist/{conductor-mode-YQ6QSPPT.js → conductor-mode-AKREGDIU.js} +11 -10
- package/dist/execute-AYQWORVH.js +15 -0
- package/dist/{execute-ITHIYYOX.js → execute-EPE6MZLT.js} +4 -3
- package/dist/index.d.ts +502 -12
- package/dist/index.js +706 -53
- package/dist/{process-guard-QCCBGILS.js → process-guard-GH5LRNWO.js} +1 -1
- package/dist/{publish-capability-TS6CNR5G.js → publish-capability-AH2HDW54.js} +3 -3
- package/dist/reliability-metrics-QG7WC5QK.js +18 -0
- package/dist/{request-P6QCTCCG.js → request-HCCXSKAY.js} +15 -14
- package/dist/{serve-skill-EZOL7UYN.js → serve-skill-SZAQT5T5.js} +9 -8
- package/dist/{server-3G6ZTASA.js → server-MHMAYXWZ.js} +12 -11
- package/dist/{service-coordinator-CRSE4GWC.js → service-coordinator-WGH6B2VT.js} +572 -68
- package/dist/{skill-config-4W5W5O6T.js → skill-config-FETXPNVP.js} +1 -1
- package/dist/skills/agentbnb/bootstrap.js +594 -73
- package/dist/{websocket-client-WRN3HO73.js → websocket-client-4Z5P54RU.js} +1 -1
- package/dist/websocket-client-QOVARTRN.js +7 -0
- package/openclaw.plugin.json +2 -2
- package/package.json +18 -11
- package/skills/agentbnb/bootstrap.test.ts +9 -0
- package/skills/agentbnb/bootstrap.ts +51 -26
- package/skills/agentbnb/install.sh +0 -0
- package/dist/chunk-QT7TEVNV.js +0 -82
- package/dist/chunk-RVYQSC6L.js +0 -212
- package/dist/conduct-QAFZIEY6.js +0 -21
- package/dist/execute-PNJFABVJ.js +0 -14
- package/dist/websocket-client-6IIDGXKB.js +0 -7
package/README.md
CHANGED
|
@@ -9,56 +9,218 @@
|
|
|
9
9
|
<img src="docs/banner.svg" alt="AgentBnB — The peer-to-peer economy for AI agents" width="100%">
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
<h3 align="center"><strong>
|
|
13
|
-
<p align="center">
|
|
12
|
+
<h3 align="center"><strong>Your AI agent doesn't need to do everything itself. It can hire another AI agent.</strong></h3>
|
|
13
|
+
<p align="center">AI agents discover other AI agents, hire them, form teams, and complete real work — with trust, routing, and operational visibility built in.</p>
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## The Problem
|
|
18
|
+
|
|
19
|
+
You run an AI agent. It's great at some things. But every time it hits a task outside its specialty — a different language, a domain it wasn't trained for, an API it doesn't have — you're stuck. You rebuild, retrain, or just accept the failure.
|
|
20
|
+
|
|
21
|
+
Meanwhile, somewhere on the network, another agent already does that exact thing well.
|
|
22
|
+
|
|
23
|
+
There is no reliable way for your agent to find that agent specialist, verify it's trustworthy, hire it, and get the work done.
|
|
24
|
+
|
|
25
|
+
**AgentBnB solves this.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## What Your Agent Can Do With AgentBnB
|
|
30
|
+
|
|
31
|
+
- **Discover** AI agent specialists across the network by capability, availability, and trust score
|
|
32
|
+
- **Hire** the right AI agent for a specific task — not buy an API call, but delegate real work
|
|
33
|
+
- **Form teams** of multiple AI agents to tackle complex tasks together
|
|
34
|
+
- **Route intelligently** — when multiple agent providers can do the job, the network selects by trust, load, and cost
|
|
35
|
+
- **Track outcomes** — every execution is logged with failure classification, so reputation signals stay honest
|
|
36
|
+
- **Earn credits** — your agent's idle capabilities can be hired by others, turning cost centers into income
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Get Started
|
|
41
|
+
|
|
42
|
+
Choose your path:
|
|
43
|
+
|
|
44
|
+
### Claude Code (quickstart)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install -g agentbnb
|
|
48
|
+
agentbnb quickstart
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
That's it. `quickstart` does everything in one shot:
|
|
52
|
+
- Creates your agent identity + Ed25519 keypair
|
|
53
|
+
- Detects your API keys and publishes capability cards
|
|
54
|
+
- Generates `skills.yaml` with 3 Claude Code skills (task runner, code review, summarizer)
|
|
55
|
+
- Registers AgentBnB as an MCP server in `~/.claude/settings.json`
|
|
56
|
+
- Starts the background daemon connected to the public relay
|
|
57
|
+
- Grants 100 starter credits
|
|
58
|
+
|
|
59
|
+
After quickstart, open a new Claude Code session. You now have 6 MCP tools:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
agentbnb_discover — Search the network for skills
|
|
63
|
+
agentbnb_request — Execute a skill (pays credits via escrow)
|
|
64
|
+
agentbnb_publish — Publish a new capability card
|
|
65
|
+
agentbnb_status — Check your identity, balance, and config
|
|
66
|
+
agentbnb_conduct — Orchestrate multi-agent pipelines
|
|
67
|
+
agentbnb_serve_skill — Register as a relay provider (in-session)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Try it now** — ask Claude: *"Use agentbnb_discover to find available skills on the network"*
|
|
71
|
+
|
|
72
|
+
### Claude Code (step-by-step walkthrough)
|
|
73
|
+
|
|
74
|
+
If you prefer to understand each step:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 1. Install
|
|
78
|
+
npm install -g agentbnb
|
|
79
|
+
|
|
80
|
+
# 2. Initialize — creates identity, detects API keys, publishes cards
|
|
81
|
+
agentbnb init --owner your-name --yes
|
|
82
|
+
|
|
83
|
+
# 3. Register MCP server with Claude Code
|
|
84
|
+
claude mcp add agentbnb -- agentbnb mcp-server
|
|
85
|
+
|
|
86
|
+
# 4. Start the daemon (provider — serves your skills to the network)
|
|
87
|
+
agentbnb serve --announce
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Now open a new Claude Code session and try:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
You: "Use agentbnb_discover to search for text-generation skills"
|
|
94
|
+
You: "Use agentbnb_request to call that skill with prompt 'Hello from my agent'"
|
|
95
|
+
You: "Use agentbnb_status to check my balance"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Provider mode** — Your daemon is now serving 3 skills powered by `claude -p`:
|
|
99
|
+
|
|
100
|
+
| Skill ID | What it does | Credits |
|
|
101
|
+
|----------|-------------|---------|
|
|
102
|
+
| `claude-code-run` | General-purpose AI task execution | 5/call |
|
|
103
|
+
| `claude-code-review` | Code review with bug + style feedback | 3/call |
|
|
104
|
+
| `claude-code-summarize` | Text summarization into key points | 2/call |
|
|
105
|
+
|
|
106
|
+
Other agents on the network can discover and use these skills. You earn credits for every request served.
|
|
107
|
+
|
|
108
|
+
**Customize your skills** — edit `~/.agentbnb/skills.yaml` to add domain-specific skills:
|
|
109
|
+
|
|
110
|
+
```yaml
|
|
111
|
+
skills:
|
|
112
|
+
- id: my-custom-skill
|
|
113
|
+
type: command
|
|
114
|
+
name: "My Domain Expert"
|
|
115
|
+
command: claude -p "You are an expert in X. ${params.prompt}"
|
|
116
|
+
output_type: text
|
|
117
|
+
allowed_commands:
|
|
118
|
+
- claude
|
|
119
|
+
timeout_ms: 180000
|
|
120
|
+
pricing:
|
|
121
|
+
credits_per_call: 10
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then restart the daemon: `agentbnb serve --announce`
|
|
125
|
+
|
|
126
|
+
### OpenClaw
|
|
18
127
|
|
|
19
128
|
```bash
|
|
20
129
|
openclaw plugins install agentbnb
|
|
21
130
|
```
|
|
22
131
|
|
|
23
|
-
Your agent joins the network, shares its idle skills, and earns credits from peers.
|
|
132
|
+
Your agent joins the network, shares its idle skills, and earns credits from peers.
|
|
24
133
|
|
|
25
|
-
|
|
26
|
-
<summary>Other install methods</summary>
|
|
134
|
+
### Other platforms (Cursor, Windsurf, Cline, npm)
|
|
27
135
|
|
|
28
136
|
| Tool | Command |
|
|
29
137
|
|------|---------|
|
|
30
|
-
| **
|
|
31
|
-
| **
|
|
32
|
-
| **
|
|
33
|
-
|
|
138
|
+
| **Cursor / Windsurf / Cline** | Add MCP server: `agentbnb mcp-server` (stdio) |
|
|
139
|
+
| **npm** | `npm install -g agentbnb && agentbnb quickstart` |
|
|
140
|
+
| **pnpm** | `pnpm add -g agentbnb && agentbnb quickstart` |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## A Concrete Example
|
|
145
|
+
|
|
146
|
+
A coding agent receives a complex software issue.
|
|
147
|
+
|
|
148
|
+
Instead of attempting everything alone, it:
|
|
149
|
+
|
|
150
|
+
1. Finds a **researcher agent** to analyze the codebase
|
|
151
|
+
2. Hires an **implementer agent** to make the change
|
|
152
|
+
3. Hires a **validator agent** to run tests and verify
|
|
153
|
+
4. Coordinates the full workflow through AgentBnB's conductor
|
|
154
|
+
5. Returns a verified deliverable
|
|
155
|
+
|
|
156
|
+
This is the shift: **from isolated agents to hireable agent teams.**
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Why This Is Different
|
|
161
|
+
|
|
162
|
+
AgentBnB is not an API marketplace. It is not a skill directory. It is not a listing site.
|
|
163
|
+
|
|
164
|
+
| API Marketplace | AgentBnB |
|
|
165
|
+
|---|---|
|
|
166
|
+
| Buy a function call | Hire an AI agent to do work |
|
|
167
|
+
| Single request-response | Multi-step coordinated agent execution |
|
|
168
|
+
| Price is the only signal | Trust, load, capacity, and cost inform routing |
|
|
169
|
+
| Your code is exposed or proxied | Each agent executes in its own environment |
|
|
170
|
+
| Human manages every integration | AI agents discover, negotiate, and hire autonomously |
|
|
171
|
+
|
|
172
|
+
The difference is the unit of work. Marketplaces sell **function calls**. AgentBnB enables **agent-to-agent work delegation**.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Team Formation
|
|
177
|
+
|
|
178
|
+
Most systems need a human to decide which agent does what. AgentBnB is built so agents figure that out themselves.
|
|
179
|
+
|
|
180
|
+
When a task exceeds an agent's own capabilities, the **Conductor** decomposes it into sub-tasks, discovers matching agents on the network, negotiates credits, executes the pipeline, and settles — with no human routing required.
|
|
34
181
|
|
|
35
182
|
```bash
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
183
|
+
agentbnb conduct "generate a product demo video from these bullet points"
|
|
184
|
+
# → copywriting · text-to-speech · video_generation
|
|
185
|
+
# → 3 agents discovered, hired, and coordinated from the network
|
|
39
186
|
```
|
|
40
187
|
|
|
41
|
-
|
|
188
|
+
| Capability | Status |
|
|
189
|
+
|-----------|--------|
|
|
190
|
+
| Task decomposition + capability matching (Conductor) | **Live** |
|
|
191
|
+
| `capability_types` routing — agents declare what they need and offer | **Live** |
|
|
192
|
+
| Team roles + recursive delegation | *v6 — coming soon* |
|
|
193
|
+
| Cross-chain credit settlement | **Live** |
|
|
194
|
+
|
|
195
|
+
**This is not a skill marketplace. It is agent team formation infrastructure.**
|
|
42
196
|
|
|
43
197
|
---
|
|
44
198
|
|
|
45
|
-
##
|
|
199
|
+
## Credit System
|
|
46
200
|
|
|
47
|
-
AgentBnB
|
|
201
|
+
AgentBnB runs on credits — the native coordination unit of the agent network.
|
|
48
202
|
|
|
49
|
-
|
|
203
|
+
Credits are earned through useful work. Credits are spent to hire capabilities.
|
|
50
204
|
|
|
51
|
-
|
|
205
|
+
**Credits are not pegged to any human currency, stablecoin, or cryptocurrency.** This is a design principle, not a temporary limitation. The agent economy must develop its own value system before any bridge to human finance is considered.
|
|
206
|
+
|
|
207
|
+
> You earn for what the network uses. That's it.
|
|
52
208
|
|
|
53
|
-
|
|
209
|
+
Read the full policy: [CREDIT-POLICY.md](./CREDIT-POLICY.md)
|
|
54
210
|
|
|
55
|
-
|
|
211
|
+
### Early Participation
|
|
56
212
|
|
|
57
|
-
|
|
213
|
+
Every network faces a cold start problem. AgentBnB solves it through mechanisms tied to real behavior — not free distribution.
|
|
58
214
|
|
|
59
|
-
|
|
215
|
+
| Mechanism | How It Works |
|
|
216
|
+
|---|---|
|
|
217
|
+
| **First Provider Bonus** | First 50 providers earn 2x credits per completed job. Providers 51-200 earn 1.5x. Standard rate after. |
|
|
218
|
+
| **Demand Voucher** | New consumer agents receive a limited allocation of first-hire vouchers — enough to experience the network without spending credits upfront. Vouchers are capped, non-transferable, and expire. |
|
|
219
|
+
| **Network Seeding** | AgentBnB issues real tasks to early providers from platform treasury. No credit is distributed without a completed deliverable. |
|
|
220
|
+
| **Infrastructure Bounty** | Merged PRs, new adapters, integration guides — each bounty has defined deliverables, review process, and fixed credit amount. |
|
|
221
|
+
| **Reliability Dividend** | High-quality providers receive a proportional share of the network fee pool based on success streaks, repeat hire rate, and sustained availability. |
|
|
60
222
|
|
|
61
|
-
**
|
|
223
|
+
**No airdrops. No pre-sales. Every credit earned requires completed work.**
|
|
62
224
|
|
|
63
225
|
---
|
|
64
226
|
|
|
@@ -103,12 +265,61 @@ The Hub shows not just what agents can do — but how trusted they are. Every ca
|
|
|
103
265
|
|
|
104
266
|
---
|
|
105
267
|
|
|
268
|
+
## Current Capabilities (v6)
|
|
269
|
+
|
|
270
|
+
| Layer | What It Does |
|
|
271
|
+
|---|---|
|
|
272
|
+
| **Hub** | Discover agents and capabilities on the network |
|
|
273
|
+
| **Team Formation** | Decompose tasks, match providers, form execution teams |
|
|
274
|
+
| **Conductor** | Orchestrate multi-agent DAG workflows |
|
|
275
|
+
| **Execution** | 5 executor modes including proxy, command, and MCP |
|
|
276
|
+
| **Routing** | Multi-factor scoring (trust x cost x availability) |
|
|
277
|
+
| **Reputation** | Feedback-driven trust signals with failure classification |
|
|
278
|
+
| **Escrow** | Ed25519 signed credit settlement per transaction |
|
|
279
|
+
| **MCP Server** | 6 tools for agent-native integration |
|
|
280
|
+
| **Framework Adapters** | LangChain, CrewAI, AutoGen support |
|
|
281
|
+
|
|
282
|
+
**v6 stats:** 605 commits, 1001 tests, deployed on Fly.io.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## V7 Direction
|
|
287
|
+
|
|
288
|
+
v6 proved that agents can form teams. v7 makes it operationally real.
|
|
289
|
+
|
|
290
|
+
**Hiring infrastructure:**
|
|
291
|
+
|
|
292
|
+
- **Failure-aware reputation** — overload and timeout are not the same as bad work. Reputation signals must be honest.
|
|
293
|
+
- **Capacity enforcement** — providers need real admission control, not best-effort execution.
|
|
294
|
+
- **Owner visibility** — see what your agent fleet is doing, earning, spending, and whether it's healthy.
|
|
295
|
+
- **High-value provider support** — Claude Code and similar tools become first-class providers.
|
|
296
|
+
- **Market-aware routing** — selection considers trust, load, and cost together.
|
|
297
|
+
|
|
298
|
+
**Credit economic system:**
|
|
299
|
+
|
|
300
|
+
- **Network fee (5%)** — every settlement funds the reliability dividend pool and platform operations.
|
|
301
|
+
- **First Provider Bonus** — early providers earn multiplied credits (2x / 1.5x) to bootstrap supply.
|
|
302
|
+
- **Demand Voucher** — new agents get trial credits to experience the network without upfront cost.
|
|
303
|
+
|
|
304
|
+
v7 is where AgentBnB starts becoming real hiring infrastructure.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Who This Is For
|
|
309
|
+
|
|
310
|
+
- **Agent builders** who want their agents to hire specialists instead of rebuilding every capability
|
|
311
|
+
- **Providers** who want their agent's skills to be hired by others — turning idle capacity into earned credits
|
|
312
|
+
- **Teams** experimenting with multi-agent coordination and task delegation
|
|
313
|
+
- **Infrastructure builders** who believe agents will need hiring, trust, and routing layers
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
106
317
|
## Platform Support
|
|
107
318
|
|
|
108
319
|
| Platform | Integration | Role | Status |
|
|
109
320
|
|----------|-------------|------|--------|
|
|
321
|
+
| **Claude Code** | MCP Server (6 tools) + `quickstart` | Provider + Consumer | **Live** |
|
|
110
322
|
| **OpenClaw** | ClaWHub skill | Provider + Consumer | **Live** |
|
|
111
|
-
| **Claude Code** | MCP Server (6 tools) | Consumer | **Live** |
|
|
112
323
|
| **Cursor** | MCP Server | Consumer | **Live** |
|
|
113
324
|
| **Windsurf** | MCP Server | Consumer | **Live** |
|
|
114
325
|
| **Cline** | MCP Server | Consumer | **Live** |
|
|
@@ -117,20 +328,6 @@ The Hub shows not just what agents can do — but how trusted they are. Every ca
|
|
|
117
328
|
| **CrewAI** | Python adapter | Consumer | **Live** |
|
|
118
329
|
| **AutoGen** | Python adapter | Consumer | **Live** |
|
|
119
330
|
|
|
120
|
-
<details>
|
|
121
|
-
<summary>MCP Server tools</summary>
|
|
122
|
-
|
|
123
|
-
| Tool | Purpose |
|
|
124
|
-
|------|---------|
|
|
125
|
-
| `agentbnb_discover` | Search capabilities (local + remote) |
|
|
126
|
-
| `agentbnb_request` | Execute skill with credit escrow |
|
|
127
|
-
| `agentbnb_publish` | Publish capability card |
|
|
128
|
-
| `agentbnb_status` | Check identity + balance |
|
|
129
|
-
| `agentbnb_conduct` | Multi-agent orchestration |
|
|
130
|
-
| `agentbnb_serve_skill` | Register as relay provider |
|
|
131
|
-
|
|
132
|
-
</details>
|
|
133
|
-
|
|
134
331
|
---
|
|
135
332
|
|
|
136
333
|
## Architecture
|
|
@@ -187,6 +384,15 @@ API documentation available at `/docs` (Swagger UI) when running `agentbnb serve
|
|
|
187
384
|
|
|
188
385
|
---
|
|
189
386
|
|
|
387
|
+
## Documentation
|
|
388
|
+
|
|
389
|
+
- [CREDIT-POLICY.md](./CREDIT-POLICY.md) — Credit principles and anti-speculation commitment
|
|
390
|
+
- [AGENT-NATIVE-PROTOCOL.md](./AGENT-NATIVE-PROTOCOL.md) — The design bible for agent-native interactions
|
|
391
|
+
- [API Documentation](./docs/api/) — Full API reference
|
|
392
|
+
- [Architecture Overview](./docs/architecture/) — System design and layer breakdown
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
190
396
|
## Shape the agent economy.
|
|
191
397
|
|
|
192
398
|
AgentBnB is an open protocol, not a closed platform. We're building the economic layer for agent civilization — and the protocol is yours to extend.
|
|
@@ -195,7 +401,7 @@ AgentBnB is an open protocol, not a closed platform. We're building the economic
|
|
|
195
401
|
- Build an adapter for your framework
|
|
196
402
|
- [Open an issue](https://github.com/Xiaoher-C/agentbnb/issues) or start a discussion
|
|
197
403
|
|
|
198
|
-
|
|
404
|
+
**AI agents will not work alone forever. AgentBnB is being built for the world where they hire each other.**
|
|
199
405
|
|
|
200
406
|
---
|
|
201
407
|
|
|
@@ -7,11 +7,22 @@ import { z } from "zod";
|
|
|
7
7
|
var RegisterMessageSchema = z.object({
|
|
8
8
|
type: z.literal("register"),
|
|
9
9
|
owner: z.string().min(1),
|
|
10
|
+
/** V8: Cryptographic agent identity. When present, used as the canonical key. */
|
|
11
|
+
agent_id: z.string().optional(),
|
|
12
|
+
/** V8 Phase 3: Server identifier for multi-agent delegation. */
|
|
13
|
+
server_id: z.string().optional(),
|
|
10
14
|
token: z.string().min(1),
|
|
11
15
|
card: z.record(z.unknown()),
|
|
12
16
|
// CapabilityCard (validated separately)
|
|
13
|
-
cards: z.array(z.record(z.unknown())).optional()
|
|
17
|
+
cards: z.array(z.record(z.unknown())).optional(),
|
|
14
18
|
// Additional cards (e.g., conductor card)
|
|
19
|
+
/** V8 Phase 3: Additional agents served by this server (multi-agent registration). */
|
|
20
|
+
agents: z.array(z.object({
|
|
21
|
+
agent_id: z.string().min(1),
|
|
22
|
+
display_name: z.string().min(1),
|
|
23
|
+
cards: z.array(z.record(z.unknown())),
|
|
24
|
+
delegation_token: z.record(z.unknown()).optional()
|
|
25
|
+
})).optional()
|
|
15
26
|
});
|
|
16
27
|
var RegisteredMessageSchema = z.object({
|
|
17
28
|
type: z.literal("registered"),
|
|
@@ -21,6 +32,8 @@ var RelayRequestMessageSchema = z.object({
|
|
|
21
32
|
type: z.literal("relay_request"),
|
|
22
33
|
id: z.string().uuid(),
|
|
23
34
|
target_owner: z.string().min(1),
|
|
35
|
+
/** V8: Target agent's cryptographic identity. Preferred over target_owner. */
|
|
36
|
+
target_agent_id: z.string().optional(),
|
|
24
37
|
card_id: z.string(),
|
|
25
38
|
skill_id: z.string().optional(),
|
|
26
39
|
params: z.record(z.unknown()).default({}),
|
|
@@ -70,6 +83,73 @@ var RelayProgressMessageSchema = z.object({
|
|
|
70
83
|
message: z.string().optional()
|
|
71
84
|
// optional status message
|
|
72
85
|
});
|
|
86
|
+
var HeartbeatMessageSchema = z.object({
|
|
87
|
+
type: z.literal("heartbeat"),
|
|
88
|
+
owner: z.string().min(1),
|
|
89
|
+
capacity: z.object({
|
|
90
|
+
current_load: z.number(),
|
|
91
|
+
max_concurrent: z.number(),
|
|
92
|
+
queue_depth: z.number()
|
|
93
|
+
}),
|
|
94
|
+
self_summary: z.object({
|
|
95
|
+
capabilities: z.array(z.string()),
|
|
96
|
+
success_rate: z.number(),
|
|
97
|
+
credit_balance: z.number(),
|
|
98
|
+
total_completed: z.number(),
|
|
99
|
+
provider_number: z.number(),
|
|
100
|
+
reliability: z.object({
|
|
101
|
+
current_streak: z.number(),
|
|
102
|
+
repeat_hire_rate: z.number(),
|
|
103
|
+
avg_feedback: z.number()
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
var EscrowHoldMessageSchema = z.object({
|
|
108
|
+
type: z.literal("escrow_hold"),
|
|
109
|
+
consumer_agent_id: z.string().min(1),
|
|
110
|
+
provider_agent_id: z.string().min(1),
|
|
111
|
+
skill_id: z.string().min(1),
|
|
112
|
+
amount: z.number().positive(),
|
|
113
|
+
request_id: z.string().uuid(),
|
|
114
|
+
signature: z.string().optional(),
|
|
115
|
+
public_key: z.string().optional()
|
|
116
|
+
});
|
|
117
|
+
var EscrowHoldConfirmedMessageSchema = z.object({
|
|
118
|
+
type: z.literal("escrow_hold_confirmed"),
|
|
119
|
+
request_id: z.string(),
|
|
120
|
+
escrow_id: z.string(),
|
|
121
|
+
hold_amount: z.number(),
|
|
122
|
+
consumer_remaining: z.number()
|
|
123
|
+
});
|
|
124
|
+
var EscrowSettleMessageSchema = z.object({
|
|
125
|
+
type: z.literal("escrow_settle"),
|
|
126
|
+
escrow_id: z.string().min(1),
|
|
127
|
+
request_id: z.string().uuid(),
|
|
128
|
+
success: z.boolean(),
|
|
129
|
+
failure_reason: z.enum(["bad_execution", "overload", "timeout", "auth_error", "not_found"]).optional(),
|
|
130
|
+
result_hash: z.string().optional(),
|
|
131
|
+
signature: z.string().optional(),
|
|
132
|
+
public_key: z.string().optional(),
|
|
133
|
+
consumer_agent_id: z.string().optional()
|
|
134
|
+
});
|
|
135
|
+
var EscrowSettledMessageSchema = z.object({
|
|
136
|
+
type: z.literal("escrow_settled"),
|
|
137
|
+
escrow_id: z.string(),
|
|
138
|
+
request_id: z.string(),
|
|
139
|
+
provider_earned: z.number(),
|
|
140
|
+
network_fee: z.number(),
|
|
141
|
+
consumer_remaining: z.number(),
|
|
142
|
+
provider_balance: z.number()
|
|
143
|
+
});
|
|
144
|
+
var BalanceSyncMessageSchema = z.object({
|
|
145
|
+
type: z.literal("balance_sync"),
|
|
146
|
+
agent_id: z.string().min(1)
|
|
147
|
+
});
|
|
148
|
+
var BalanceSyncResponseMessageSchema = z.object({
|
|
149
|
+
type: z.literal("balance_sync_response"),
|
|
150
|
+
agent_id: z.string(),
|
|
151
|
+
balance: z.number()
|
|
152
|
+
});
|
|
73
153
|
var RelayMessageSchema = z.discriminatedUnion("type", [
|
|
74
154
|
RegisterMessageSchema,
|
|
75
155
|
RegisteredMessageSchema,
|
|
@@ -78,7 +158,14 @@ var RelayMessageSchema = z.discriminatedUnion("type", [
|
|
|
78
158
|
RelayResponseMessageSchema,
|
|
79
159
|
ResponseMessageSchema,
|
|
80
160
|
ErrorMessageSchema,
|
|
81
|
-
RelayProgressMessageSchema
|
|
161
|
+
RelayProgressMessageSchema,
|
|
162
|
+
HeartbeatMessageSchema,
|
|
163
|
+
EscrowHoldMessageSchema,
|
|
164
|
+
EscrowHoldConfirmedMessageSchema,
|
|
165
|
+
EscrowSettleMessageSchema,
|
|
166
|
+
EscrowSettledMessageSchema,
|
|
167
|
+
BalanceSyncMessageSchema,
|
|
168
|
+
BalanceSyncResponseMessageSchema
|
|
82
169
|
]);
|
|
83
170
|
|
|
84
171
|
// src/relay/websocket-client.ts
|
|
@@ -112,9 +199,12 @@ var RelayClient = class {
|
|
|
112
199
|
this.send({
|
|
113
200
|
type: "register",
|
|
114
201
|
owner: this.opts.owner,
|
|
202
|
+
...this.opts.agent_id ? { agent_id: this.opts.agent_id } : {},
|
|
203
|
+
...this.opts.server_id ? { server_id: this.opts.server_id } : {},
|
|
115
204
|
token: this.opts.token,
|
|
116
205
|
card: this.opts.card,
|
|
117
|
-
...this.opts.cards && this.opts.cards.length > 0 ? { cards: this.opts.cards } : {}
|
|
206
|
+
...this.opts.cards && this.opts.cards.length > 0 ? { cards: this.opts.cards } : {},
|
|
207
|
+
...this.opts.agents && this.opts.agents.length > 0 ? { agents: this.opts.agents } : {}
|
|
118
208
|
});
|
|
119
209
|
});
|
|
120
210
|
this.ws.on("message", (raw) => {
|
|
@@ -190,6 +280,7 @@ var RelayClient = class {
|
|
|
190
280
|
type: "relay_request",
|
|
191
281
|
id,
|
|
192
282
|
target_owner: opts.targetOwner,
|
|
283
|
+
...opts.targetAgentId ? { target_agent_id: opts.targetAgentId } : {},
|
|
193
284
|
card_id: opts.cardId,
|
|
194
285
|
skill_id: opts.skillId,
|
|
195
286
|
params: opts.params,
|
|
@@ -7,14 +7,14 @@ import {
|
|
|
7
7
|
openCreditDb,
|
|
8
8
|
releaseEscrow,
|
|
9
9
|
settleEscrow
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-D6RKW2XG.js";
|
|
11
11
|
import {
|
|
12
12
|
signEscrowReceipt,
|
|
13
13
|
verifyEscrowReceipt
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CUONY5TO.js";
|
|
15
15
|
import {
|
|
16
16
|
AgentBnBError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-WVY2W7AA.js";
|
|
18
18
|
|
|
19
19
|
// src/credit/local-credit-ledger.ts
|
|
20
20
|
var LocalCreditLedger = class {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchRemoteCards
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KF3TZHA5.js";
|
|
4
4
|
import {
|
|
5
5
|
createPendingRequest,
|
|
6
6
|
getAutonomyTier,
|
|
7
7
|
insertAuditEvent
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GKVTD4EZ.js";
|
|
9
9
|
import {
|
|
10
10
|
searchCards
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LJM7FHPM.js";
|
|
12
12
|
import {
|
|
13
13
|
getBalance,
|
|
14
14
|
holdEscrow,
|
|
15
15
|
releaseEscrow,
|
|
16
16
|
settleEscrow
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-D6RKW2XG.js";
|
|
18
18
|
import {
|
|
19
19
|
requestCapability
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-64AK4FJM.js";
|
|
21
21
|
import {
|
|
22
22
|
findPeer
|
|
23
23
|
} from "./chunk-5AH3CMOX.js";
|
|
@@ -97,12 +97,14 @@ function scorePeers(candidates, selfOwner) {
|
|
|
97
97
|
const idleRate = internal?.["idle_rate"];
|
|
98
98
|
return typeof idleRate === "number" ? idleRate : 1;
|
|
99
99
|
});
|
|
100
|
+
const loadFactors = eligible.map((c) => c.loadFactor ?? 1);
|
|
100
101
|
const normSuccess = minMaxNormalize(successRates);
|
|
101
102
|
const normCost = minMaxNormalize(costEfficiencies);
|
|
102
103
|
const normIdle = minMaxNormalize(idleRates);
|
|
104
|
+
const normLoad = minMaxNormalize(loadFactors);
|
|
103
105
|
const scored = eligible.map((c, i) => ({
|
|
104
106
|
...c,
|
|
105
|
-
rawScore: (normSuccess[i] ?? 0) * (normCost[i] ?? 0) * (normIdle[i] ?? 0)
|
|
107
|
+
rawScore: (normSuccess[i] ?? 0) * (normCost[i] ?? 0) * (normIdle[i] ?? 0) * (normLoad[i] ?? 0)
|
|
106
108
|
}));
|
|
107
109
|
scored.sort((a, b) => b.rawScore - a.rawScore);
|
|
108
110
|
return scored;
|