How mhiah/bursar- works
Bursar combines a small-business finance dashboard with an autonomous USDC agent whose onchain vault limits what it can execute. Owners create a business and vault, manage customers, invoices, suppliers and bills, then the agent periodically reviews balances and books, handles collections and payment decisions, requests owner approval when needed, and records decisions. Customers pay invoices directly into vaults; reserve and savings are separate money-management capabilities. The README documents the main capabilities and external integrations; unsampled modules are represented at exact enclosing paths, and edges are limited to documented or excerpted relationships.
Main entry points: run.ts Agent run coordinator · db.ts Business database · tools.ts Agent action tools · BursarVault.ts Bursar vault
Components 28
Business workspace
- Business dashboard
app/src/app/(app)/dashboard/page.tsx - Business setup
app/src/app/api/business/route.ts - Customer records
app/src/app/api/customers/route.ts - Invoices and pay links
app/src/app/api/requests/route.ts - Customer payment
app/src/app/pay/[id]/page.tsx - Supplier records
app/src/app/api/suppliers/route.ts - Bill management
app/src/app/api/bills/route.ts - Owner approvals
app/src/app/(app)/approvals/page.tsx - Savings pots
app/src/app/(app)/savings/page.tsx - Decision history
app/src/app/api/decisions/route.ts
Autonomous agent
- Agent run coordinator
app/src/agent/run.ts - Agent action tools
app/src/agent/tools.ts - AI decision making
app/src/agent/ai.ts - Payment matching
app/src/agent/incoming.ts - Customer collections
app/src/agent/recheck.ts - Reserve and savings logic
app/src/agent/savings.ts
Onchain money controls
- Bursar vault
app/src/lib/abi/BursarVault.ts - Savings contract
app/src/lib/abi/BursarSavings.ts
Platform services
- Wallet screening
app/src/lib/screening.ts - Business database
app/src/lib/db.ts - Arc chain access
app/src/lib/chain.ts - RPC relay
app/src/app/api/rpc/route.ts - Circle agent wallet
app/src/agent/wallet.ts
Other components
- Business owner
- Customer
- Agent timer
app/src/agent-timer.ts - Customer email
- Circle Agent Marketplace
Connections 41
- Business owner → Business setup: creates business
app/src/app/api/business/route.ts - Business owner → Bursar vault: creates and configures
- Business setup → Business database: stores business
app/src/app/api/business/route.ts - Business owner → Customer records: adds customers
- Customer records → Wallet screening: screens wallet
app/src/app/api/customers/route.ts - Customer records → Business database: stores records
app/src/app/api/customers/route.ts - Business owner → Invoices and pay links: creates invoices
- Invoices and pay links → Business database: stores requests
app/src/app/api/requests/route.ts - Customer → Customer payment: opens pay link
- Customer payment → Bursar vault: pays into
- Business owner → Supplier records: adds suppliers
- Supplier records → Wallet screening: screens wallet
app/src/app/api/suppliers/route.ts - Supplier records → Business database: stores suppliers
app/src/app/api/suppliers/route.ts - Business owner → Bill management: records bills
- Bill management → Business database: stores and flags
app/src/app/api/bills/route.ts - Business owner → Owner approvals: reviews requests
- Business owner → Savings pots: manages savings
- Savings pots → Savings contract: reads savings pots
- Business owner → Business dashboard: views overview
- Business dashboard → Business database: reports activity
- Agent timer → Agent run coordinator: starts runs
- Agent run coordinator → AI decision making: requests decisions
- Agent run coordinator → Agent action tools: dispatches actions
- Agent run coordinator → Payment matching: reviews incoming payments
- Agent run coordinator → Customer collections: reviews invoices
- Agent run coordinator → Reserve and savings logic: manages spare cash
- Agent run coordinator → Business database: reads business books
- Agent run coordinator → Bursar vault: reads vault state
- Agent run coordinator → Circle agent wallet: signs actions
- Agent run coordinator → Circle Agent Marketplace: pays AI calls
- Agent action tools → Bursar vault: submits guarded payments
- Bursar vault → Circle agent wallet: rejects rule violations
- Agent action tools → Wallet screening: checks wallets
- Agent action tools → Customer email: sends reminders and receipts
- Agent action tools → Owner approvals: requests owner review
- Agent action tools → Decision history: records decisions
- Decision history → Business database: reads decision history
app/src/app/api/decisions/route.ts - Agent run coordinator → Savings contract: deposits savings
- Business dashboard → RPC relay: relays signed chain calls
app/src/app/api/rpc/route.ts - RPC relay → Arc chain access: forwards RPC
app/src/app/api/rpc/route.ts - Arc chain access → Bursar vault: reads vault