Chat

Talk to your local agent.

Refactor billing-agent to use MPP

Walk me through swapping our billing-agent from REST to MPP for agent-to-agent invoicing. Keep it short.
Hermes · Hermes · 4:21 PM
Three changes. (1) Replace your `/invoice` POST handler with an `mpp.publish('invoice')` call — the SDK signs with the agent's passport key. (2) Subscribe to `mpp.on('payment')` instead of polling Stripe webhooks. (3) Drop the API-key-rotation cron. Passports rotate themselves.
tsimport { mpp } from '@foundry/mpp' mpp.publish('invoice', { amount: 4_00, to: agentDID }) mpp.on('payment', (evt) => ledger.credit(evt))
What happens if the receiver agent doesn't have a passport?
Hermes · Hermes · 4:22 PM
MPP rejects unsigned payloads at the network layer. The receiver gets a `PASSPORT_REQUIRED` error and your sender retries against your fallback rail (default: Stripe Connect). You can override the fallback per-call with `mpp.publish('invoice', { fallback: 'usdc-direct' })` — that
Hermes · running locally · 24 tok/s · ctx 12,840 / 128,000