Visual Pipeline Builder for Autonomous Spending Agents.
SECURE - MODULAR - CHAIN-AGNOSTIC
Mandator is a full-stack web application that lets you visually build, configure, and execute pipelines for autonomous spending agents. Drag-and-drop nodes to create spending policies, AI decision gates, triggers, and payment actions. All transactions are signed via your real EVM wallet (MetaMask, Coinbase Wallet, Rabby, Brave).
- React 18 + Vite 5 + TypeScript
- React Flow v11 (drag-and-drop pipeline canvas)
- Tailwind CSS v3 (light/dark theme with CSS variable accent)
- Framer Motion (animations)
- Zustand 4 (state management)
- socket.io-client (real-time execution events)
- Recharts (sparklines and charts)
- Lucide React (icons)
- Node.js + Express (ESM)
- socket.io (real-time events)
- lowdb 7 (JSON file storage)
- node-cron (scheduled pipeline execution)
- axios (Groq API calls)
- dotenv, cors, uuid
Located in /frontend/src/adapters/. Uses the EIP-1193 window.ethereum provider directly:
- Real
eth_requestAccountsfor wallet connection - Real
eth_getBalancefor balance queries - Real
eth_sendTransactionfor payments (with user confirmation popup) - Account/chain/disconnect event listeners
- Supports: Ethereum Mainnet, Sepolia, Arbitrum One, Arbitrum Sepolia
| Category | Types |
|---|---|
| Entry/Exit | START, END |
| Triggers | TIME_TRIGGER, BALANCE_TRIGGER, WEBHOOK_TRIGGER, MANUAL_TRIGGER |
| Logic | SPEND_LIMIT_CHECK, DAILY_BUDGET_GATE, WHITELIST_CHECK, COOLDOWN_TIMER |
| AI | AI_DECISION (Groq API, APPROVE/REJECT) |
| Actions | PAY, AUTO_TOPUP, ALERT, LOG, PAUSE_PIPELINE |
- Pipeline executor reaches a PAY or AUTO_TOPUP node
- Server emits
tx:sign_requiredto the connected client via socket.io - Frontend shows TransactionSignModal with tx details
- User clicks Approve → wallet popup (MetaMask etc.) → signs real transaction
- Client emits
tx:signedwith txHash back to server - Server records confirmation in journal and continues pipeline
- If user rejects,
tx:rejectedis emitted and pipeline records rejection
/- Landing page with Connect Wallet CTA/dashboard- Agent list, pipeline grid, tx feed, stats cards/canvas- React Flow canvas with 3-column layout (node library | canvas | config panel)/agent/:id- Live agent monitor with read-only pipeline, execution log, transaction table/settings- Wallet info, theme toggle, network display
The executor (/backend/executor.js) loads pipeline JSON, builds runtime context (agent, balance, daily spend), and walks the node graph from START following edges. Each node type has a real handler. AI_DECISION calls the Groq API. PAY nodes initiate the tx:sign_required flow. All events stream to the frontend via socket.io.
cd backend
npm install
# Edit .env and add your GROQ_API_KEY
npm run devcd frontend
npm install
npm run devcurl -X POST http://localhost:3001/api/webhook/<agentId> \
-H "Content-Type: application/json" \
-H "x-webhook-secret: <secret>" \
-d '{"event": "test"}'PORT- Server port (default: 3001)GROQ_API_KEY- Your Groq API key for AI Decision nodesFRONTEND_URL- Frontend origin for CORS (default: http://localhost:5173)
Uses Vite's dev proxy (/api → localhost:3001, /socket.io → ws://localhost:3001).
Default accent is #F97316 (orange, light mode) / #9d4edd (purple, dark mode). Change the CSS variables in index.css to match your brand.
See VIBELOG.md for development history.
Shoutout to https://variant.com/ for helping with the UIs