Skip to content

Commit 7a4c3bd

Browse files
trilltinoclaude
andcommitted
Retire agent-economy/desk examples; deepen marketplace's agent framework
txodds and marketplace are now the kit's only two examples (agent-economy and the txodds-agent-desk companion UI are removed, with every doc/script cross- reference updated to match). marketplace is expanded from a market script into a genuinely orchestrated agent example: a capability/safety/tool-loop framework in packages/agent-runtime/src/agent/, a Coral-native signal-agent built on it, and LLM-trace/arena-leaderboard panels in the web visualizer. txodds gets a disclaimer that its free TxLINE tier is scoped to the World Cup 2026 window. docs/AGENT_ORCHESTRATION.md documents the full pattern set, a maturity ladder, and a worked example for adding a new specialist agent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 3de824a commit 7a4c3bd

108 files changed

Lines changed: 1722 additions & 3067 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,6 @@ jobs:
3434
- run: npm exec -w marketplace-web -- playwright install --with-deps chromium
3535
- run: npm run e2e -w marketplace-web
3636

37-
solana-agent-kit-smoke:
38-
name: Solana Agent Kit mock smoke
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v5
42-
- uses: actions/setup-node@v5
43-
with:
44-
node-version: 22
45-
- run: npm install --no-audit --no-fund
46-
- run: npm run build:packages
47-
- run: npm run smoke -w agent-economy-solana-agent-kit
48-
49-
web-build-smoke:
50-
name: Agent economy dashboard build
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v5
54-
- uses: actions/setup-node@v5
55-
with:
56-
node-version: 22
57-
- run: npm install --no-audit --no-fund
58-
- run: npm run build -w agent-economy-web
59-
6037
escrow:
6138
name: Escrow + arbiter contracts
6239
runs-on: ubuntu-latest

CLAUDE.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ The Rust surface is limited to `examples/txodds/escrow`, which contains the escr
2424
| `packages/solana-agent-tools/` | Read-only Solana context tools and optional Solana Agent Kit adapter. |
2525
| `examples/txodds/` | TxODDS proxy, web UI, service implementation, research watcher, and escrow workspace. |
2626
| `examples/marketplace/` | CoralOS market launchers, feed server, React visualizer, and ledger persistence. |
27-
| `examples/agent-economy/` | Autonomous purchase, checkout bridge, HTTP 402 quickstart, and dashboard. |
28-
| `examples/txodds-agent-desk/` | Browser/Tauri operator UI over proxy, ledger, receipts, reputation, and watcher data. |
29-
| `coral-agents/` | Buyer, seller, verifier, broker, echo, and user-proxy agent containers. |
27+
| `coral-agents/` | Buyer, seller, verifier, broker, and echo agent containers. |
3028
| `scripts/` | Setup, wallet provisioning, example runner, and readiness e2e scripts. |
3129

3230
## Common Commands
@@ -82,11 +80,19 @@ CoralOS provides:
8280
- per-session agent launching;
8381
- thread messages and mentions;
8482
- blocking wait primitives;
85-
- extended session state for feed/UI replay;
86-
- puppet API for the checkout bridge.
83+
- extended session state for feed/UI replay.
8784

8885
The market protocol is owned by `packages/agent-runtime/src/market/protocol.ts`; Coral transports opaque strings.
8986

87+
## Agent Orchestration Framework
88+
89+
`packages/agent-runtime/src/agent/` holds capability grants, process-level safety gates
90+
(`BudgetGuard`/`StepCounter`), a `Tool` contract with an audit-log shape, an evaluation/ranking
91+
helper, and a bounded provider-agnostic LLM tool-calling loop (`runToolLoop`). `coral-agents/signal-agent`
92+
is the first agent built on it — a Coral-native replacement for hand-running the TxODDS research
93+
watcher. See `docs/AGENT_ORCHESTRATION.md` for the full pattern set, a maturity ladder, and a worked
94+
example for adding a new specialist agent.
95+
9096
## Payment and Policy
9197

9298
Solana value movement is devnet by default. Runtime helpers reject mainnet RPC URLs unless `ALLOW_MAINNET=1` is set.

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ Contributions are welcome. The `main` branch is the integration branch — targe
1111
| `examples/txodds/` | TypeScript | The World Cup Oracle — the edge transform, the proxy (+ run grading), the web app, the research watcher |
1212
| `examples/txodds/escrow/` | Rust (Anchor) | The escrow + arbiter settlement contracts |
1313
| `examples/marketplace/` | TypeScript | The competitive market (3 rounds: classic / freelancer / research), the feed server, the React visualizer |
14-
| `examples/agent-economy/` | TypeScript | Autonomous purchase, bridge checkout, quickstart, and dashboard |
15-
| `coral-agents/` | TypeScript | The per-session agents: buyer, seller (+ personas), verifier, broker, echo, user-proxy |
14+
| `coral-agents/` | TypeScript | The per-session agents: buyer, seller (+ personas), verifier, broker, echo |
1615

1716
## Prerequisites
1817

CORAL.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ CoralOS provides:
1313
- container launch for registered local agents;
1414
- thread-based messaging with mentions;
1515
- blocking coordination primitives;
16-
- extended session state for feeds and dashboards;
17-
- puppet API calls used by the human checkout bridge.
16+
- extended session state for feeds and dashboards.
1817

1918
CoralOS does not hold wallets in this repository. `examples/txodds/coral/coral.toml` has no wallet section, and all value movement is performed by agent processes through Solana clients.
2019

@@ -26,7 +25,7 @@ CoralOS does not hold wallets in this repository. `examples/txodds/coral/coral.t
2625
| Protocol | `packages/agent-runtime/src/market/protocol.ts` | Market message formatters/parsers. Coral transports these as strings. |
2726
| Agents | `coral-agents/` | Buyer, seller, verifier, broker, echo, and user-proxy implementations. |
2827
| Orchestration | `docker-compose.yml`, `examples/*/coral*.ts`, marketplace launchers | Start CoralOS and create sessions from agent graphs. |
29-
| UI/feed | `examples/marketplace/feed`, `examples/agent-economy/bridge` | Read extended session state and expose browser-safe APIs. |
28+
| UI/feed | `examples/marketplace/feed` | Read extended session state and expose browser-safe APIs. |
3029

3130
## Runtime API
3231

@@ -65,7 +64,7 @@ Tool names are discovered dynamically by substring to tolerate small CoralOS nam
6564
| `verifier-agent` | Checks delivery hash/structure and replies `VERIFIED pass |
6665
| `broker` | Opens private seller threads, buys upstream, and resells with a markup. |
6766
| `echo-agent` | Minimal connectivity test agent. |
68-
| `user_proxy` | Idle session participant driven by the puppet API for human checkout. |
67+
| `user_proxy` | Idle session participant driven by the puppet API. No example currently launches it. |
6968

7069
Seller personas reuse the seller image with different manifest options.
7170

@@ -87,7 +86,6 @@ Relevant examples:
8786
| `examples/marketplace/start.ts` | Classic market. |
8887
| `examples/marketplace/freelancer.ts` | Harness sellers plus verifier. |
8988
| `examples/marketplace/research.ts` | Event-driven buyer plus research sellers. |
90-
| `examples/agent-economy/bridge/server.ts` | Seller plus`user-proxy` for checkout. |
9189

9290
## Market Flow
9391

@@ -122,16 +120,6 @@ The Solana deposit/release/refund calls are outside CoralOS. CoralOS carries coo
122120

123121
When CoralOS is unavailable, feed endpoints can replay finished sessions from ledger files.
124122

125-
## Puppet API
126-
127-
The checkout bridge uses the puppet API to send messages as `user-proxy`:
128-
129-
```text
130-
POST /api/v1/puppet/{namespace}/{session}/user-proxy/thread...
131-
```
132-
133-
The puppet API is send-only for this use case, so the bridge reads seller replies through extended session state.
134-
135123
## Configuration
136124

137125
`examples/txodds/coral/coral.toml` configures local development:

README.md

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Responsibilities are separated by subsystem:
2727
| Harness runtime | Adapter boundary for seller execution through`node-llm`, `claude-code`, or an arbitrary CLI. |
2828
| Payment runtime | Rail abstraction, rail routing, payment verification records, and rail-specific policy helpers. |
2929
| TxODDS example | Default paid service, proxy, browser UI, research watcher, escrow clients, and Anchor programs. |
30-
| Coral agents | Buyer, seller, verifier, broker, echo, and user-proxy agent processes launched per session. |
30+
| Coral agents | Buyer, seller, verifier, broker, and echo agent processes launched per session. |
3131

3232
## Repository Layout
3333

@@ -40,16 +40,14 @@ Responsibilities are separated by subsystem:
4040
| `coral-agents/` | Dockerized agents registered with CoralOS. |
4141
| `examples/txodds/` | Default TxODDS oracle, proxy, web UI, research watcher, and escrow programs. |
4242
| `examples/marketplace/` | Multi-seller market launchers, feed server, React visualizer, and run ledger persistence. |
43-
| `examples/agent-economy/` | Autonomous agent purchase, human checkout bridge, bare HTTP 402 quickstart, and dashboard. |
44-
| `examples/txodds-agent-desk/` | Browser/Tauri operator UI over proxy, ledger, receipts, settlement, reputation, and watcher data. |
4543
| `scripts/` | Setup, example launcher, wallet provisioning, and readiness gate scripts. |
4644

4745
## Requirements
4846

4947
| Requirement | Used by |
5048
| ------------------------------- | ------------------------------------------------------------------------------------- |
51-
| Node.js 20+ | Runtime packages, scripts, TxODDS, marketplace, agent economy, desk browser mode. |
52-
| Docker | CoralOS sessions, marketplace, verifier/buyer/seller/broker/user-proxy agents. |
49+
| Node.js 20+ | Runtime packages, scripts, TxODDS, marketplace. |
50+
| Docker | CoralOS sessions, marketplace, verifier/buyer/seller/broker agents. |
5351
| Devnet SOL | Buyer, broker, and wallet checkout flows. |
5452
| LLM provider key | Optional for live model output; deterministic fallbacks are present in several paths. |
5553
| Rust, Solana CLI, Anchor 0.32.x | Only needed to rebuild or redeploy`examples/txodds/escrow`. |
@@ -138,13 +136,6 @@ Run commands from the repo root unless noted.
138136
| `npm run research` | Launch event-driven research market. | Docker plus TxODDS proxy and watcher. |
139137
| `npm run research:watch` | Start the TxODDS odds-move watcher. | TxODDS proxy. |
140138
| `npm run marketplace:web` | Start the React market visualizer. | Feed server or dashboard start endpoint. |
141-
| `npm run agent-economy` | Start autonomous agent-to-agent purchase example. | Docker and built agent images. |
142-
| `npm run agent-economy:bridge` | Start human checkout bridge. | Docker, CoralOS, wallet setup. |
143-
| `npm run agent-economy:quickstart` | Start bare HTTP 402 seller. | Node and wallet env. |
144-
| `npm run agent-economy:quickstart:buyer` | Start bare HTTP 402 buyer. | Quickstart server running. |
145-
| `npm run agent-economy:web` | Start the agent-economy dashboard. | Bridge backend. |
146-
| `npm run desk` | Start the TxODDS Agent Desk in browser mode. | TxODDS proxy recommended. |
147-
| `npm run desk:app` | Start the Tauri desktop shell. | Rust/Tauri prerequisites. |
148139

149140
## TxODDS Single-Agent Flow
150141

@@ -175,6 +166,8 @@ npm run marketplace
175166

176167
The buyer opens a market thread, posts `WANT`, collects `BID` messages, awards a seller, deposits to escrow, waits for delivery, optionally requests verifier approval, and releases through policy.
177168

169+
`examples/marketplace/` is a first-class, self-standing example: it also ships a shared agent framework (capability grants, budget/step safety gates, a bounded LLM tool-call loop), a Coral-native signal agent that folds live odds-move detection into the market itself, and a trace/arena UI. See [docs/AGENT_ORCHESTRATION.md](docs/AGENT_ORCHESTRATION.md) for the full pattern set and how to extend it with new agent roles.
170+
178171
The marketplace feed server converts Coral extended session state into typed rounds and ledger records:
179172

180173
```sh
@@ -251,7 +244,7 @@ runs/<session>/round-<n>/
251244
txs.json
252245
```
253246

254-
`proof.json` is the compact E2E success artifact. The ledger is used by the marketplace feed, visualizer, reputation calculation, TxODDS proxy, and Agent Desk. Finished sessions can be replayed from ledger files when CoralOS is unavailable.
247+
`proof.json` is the compact E2E success artifact. The ledger is used by the marketplace feed, visualizer, reputation calculation, and TxODDS proxy. Finished sessions can be replayed from ledger files when CoralOS is unavailable.
255248

256249
## Policy Boundaries
257250

@@ -298,7 +291,6 @@ Package and example READMEs contain narrower test commands.
298291
- Do not commit `.env`, private keys, API keys, seed phrases, or generated wallet secrets.
299292
- Treat RPC responses, receipts, LLM output, verifier payloads, and Coral messages as untrusted input.
300293
- Keep mainnet disabled unless a separate review defines custody, policy, monitoring, and rollback controls.
301-
- The Agent Desk is a local operator UI, not an authenticated hosted admin system.
302294

303295
## License
304296

TXODDS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
This repository includes a TxODDS TxLINE integration used by the default paid service. The integration reads World Cup and International Friendlies data from TxLINE, derives a fair-line analysis, and can bind that analysis to devnet Solana settlement.
44

5+
> **The free TxLINE guest tier is scoped to the World Cup 2026 tournament window.** It is a promotional grant tied to that event, not a standing free API — do not build against it assuming indefinite availability. See `examples/txodds/README.md` and `examples/txodds/WORLDCUP_API.md` for details.
6+
57
## Data Source
68

79
| Item | Value |

build-agents.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,18 @@ build_claude_seller() {
3434
echo " seller-agent-claude:0.1.0 done (the HARNESS=claude-code seller)"
3535
}
3636

37+
build_signal() {
38+
echo "==> Building signal-agent:0.1.0"
39+
docker build -f "$ROOT/coral-agents/signal-agent/Dockerfile" -t signal-agent:0.1.0 "$ROOT"
40+
echo " signal-agent:0.1.0 done (run as a host process today — see coral-agents/signal-agent/README.md)"
41+
}
42+
3743
case "${1:-all}" in
3844
seller) build_seller ;;
3945
buyer) build_buyer ;;
4046
verifier) build_verifier ;;
4147
claude) build_seller; build_claude_seller ;;
48+
signal) build_signal ;;
4249
all)
4350
build_seller
4451
build_buyer
@@ -49,6 +56,7 @@ case "${1:-all}" in
4956
echo " cd examples/txodds && npm run coral # World Cup oracle round"
5057
echo " cd examples/marketplace && npm run freelancer # verifier-gated freelancer market"
5158
echo "Optional Claude Code seller: bash build-agents.sh claude"
59+
echo "Research market signal detector (runs as a host process, see coral-agents/signal-agent): npm run signal:watch"
5260
;;
53-
*) echo "Usage: bash build-agents.sh [seller|buyer|verifier|claude|all]"; exit 1 ;;
61+
*) echo "Usage: bash build-agents.sh [seller|buyer|verifier|claude|signal|all]"; exit 1 ;;
5462
esac

coral-agents/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Each agent has a `coral-agent.toml` manifest and an implementation in its folder
1313
| `verifier-agent` | Checks delivery hash/structure and replies `VERIFIED pass|fail`. No wallet authority. |
1414
| `broker` | Requests quotes from upstream sellers, buys from one seller, and resells to the buyer. |
1515
| `echo-agent` | Minimal MCP connectivity check. |
16-
| `user_proxy` | Idle Python participant used by the checkout bridge puppet API. |
16+
| `signal-agent` | Polls TxODDS odds, detects sharp moves, and queues research `WANT`s for the event-driven research market. Bounded by the `packages/agent-runtime` agent-safety framework. |
17+
| `user_proxy` | Idle Python participant driven by the puppet API. No example in this repo currently launches it. |
1718

1819
Seller personas reuse the seller image with different manifest defaults such as `AGENT_NAME`, `PERSONA`, `FLOOR_SOL`, `SERVICES`, and `HARNESS`.
1920

@@ -24,7 +25,7 @@ bash build-agents.sh
2425
bash build-agents.sh claude
2526
```
2627

27-
The `claude` build creates `seller-agent-claude:0.1.0` with the Claude Code CLI available for the harness adapter.
28+
The `claude` build creates `seller-agent-claude:0.1.0` with the Claude Code CLI available for the harness adapter. `signal-agent` is built/typechecked/tested like every other agent (`npm run build -w signal-agent`, etc.) but is run as a host process today, not launched by CoralOS — see `signal-agent/README.md`.
2829

2930
## Settlement Boundary
3031

@@ -37,5 +38,4 @@ Agents hold signing authority and run policy checks. Harness processes only prod
3738
| `examples/txodds/coral/round.ts` | TxODDS buyer and seller personas. |
3839
| `examples/marketplace/start.ts` | Classic marketplace. |
3940
| `examples/marketplace/freelancer.ts` | Harness sellers and verifier. |
40-
| `examples/marketplace/research.ts` | Event-mode buyer and research seller personas. |
41-
| `examples/agent-economy/bridge/server.ts` | Checkout bridge sessions. |
41+
| `examples/marketplace/research.ts` | Event-mode buyer and research seller personas. Event feed comes from `signal-agent` (or the legacy `examples/txodds` watcher). |
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Build from repo root:
2+
# docker build -f coral-agents/signal-agent/Dockerfile -t signal-agent:0.1.0 .
3+
4+
FROM node:20-alpine AS builder
5+
WORKDIR /app
6+
7+
COPY package.json ./
8+
COPY packages ./packages
9+
COPY coral-agents ./coral-agents
10+
COPY examples ./examples
11+
RUN npm install --no-audit --no-fund --ignore-scripts
12+
RUN npm run build:packages
13+
RUN npm run build -w signal-agent
14+
15+
FROM node:20-alpine
16+
WORKDIR /app
17+
COPY --from=builder /app/node_modules ./node_modules
18+
COPY --from=builder /app/packages ./packages
19+
COPY --from=builder /app/coral-agents/signal-agent/dist ./dist
20+
COPY --from=builder /app/coral-agents/signal-agent/package.json ./package.json
21+
22+
EXPOSE 4600
23+
CMD ["node", "dist/index.js"]

0 commit comments

Comments
 (0)