- sdk: config + contracts/{registry,escrow,services,tipjar} + x402/{client,server,types} + treasury/{policy,guard,simulate}, namespaced in barrel (0 tsc errors)
- mercator: prompts.ts (orchestrator system/selection/settlement prompts) + demo/full-loop.ts (planner->loop->trace)
- completes plan.md's package file trees
Mercator — the Stoa flagship agent (Phase 2)
Mercator runs the full agent-to-agent commerce loop on Pharos using the six Stoa skills. Every step is a real testnet transaction:
- Identity — Mercator registers in
StoaRegistry. - Listing — Mercator lists a paid service behind an x402 paywall (
x402_monetize). - Discovery & trust — a buyer agent resolves Mercator and checks its reputation.
- Hire — the buyer funds a milestone escrow (
agent_escrow). - Subcontract — to fulfill the job, Mercator itself pays a data provider via
x402_pay(agent paying agent — the value cascade). - Settle — the buyer releases the milestone on delivery.
- Rate — the buyer writes an on-chain reputation attestation.
buyer ──hire(escrow)──▶ Mercator ──subcontract(x402)──▶ data provider
▲ │
└────rate(reputation)──────┘ ◀──release(escrow)──
Run
# two funded Atlantic testnet keys + deployed Stoa contracts
export MERCATOR_SELLER_KEY=0x... # Mercator
export MERCATOR_BUYER_KEY=0x... # the hiring agent
export PHAROS_RPC_URL=https://atlantic.dplabs-internal.com/
export STOA_REGISTRY_ADDRESS=0x...
export STOA_ESCROW_ADDRESS=0x...
export X402_FACILITATOR_URL=https://... # optional, enables the x402 steps
export SUBCONTRACT_URL=https://... # optional, an external paid endpoint
pnpm --filter @stoa/agent-mercator start
Each step degrades gracefully: if a prerequisite (a contract address, the facilitator) is not configured, that step is skipped with a printed reason instead of aborting the run — so you can demo incrementally as you wire up infrastructure. At the end Mercator prints every on-chain tx hash it produced.