How dami904/bursar works
Bursar gives AI agents scoped keys to spend from a shared, job-level USDC budget. Owners configure jobs and review approvals in the web console; agents initiate purchases through MCP or HTTP. The API checks policy and reserves funds, while the worker executes and reconciles payments, and JobVault on Arc enforces release limits. The README establishes this separation; several subsystem implementations are unsampled, so their internal links are shown only where documented or visible in the source index.
Main entry points: app.ts HTTP API · executor.ts Payment executor · worker.ts Worker scheduler · spend.ts Spend and reservation
Components 24
User surfaces
- Web console
apps/web/src/main.tsx - MCP tools
apps/mcp/src/server.ts - Agent API client
apps/mcp/src/client.ts - AI operator
apps/operator/src/operator.ts - Model providers
apps/operator/src/model.ts
API and controls
- HTTP API
apps/api/src/app.ts - Key and sign-in auth
apps/api/src/services/auth.ts - Owner console services
apps/api/src/services/console.ts - Spend and reservation
apps/api/src/services/spend.ts - Payment approvals
apps/api/src/services/approvals.ts - Spend policy
packages/policy/src/policy.ts
Payment execution
- Payment integrations
packages/payments/src/x402.ts - Gateway payments
packages/payments/src/gateway.ts - Seller storefront
apps/seller/src/app.ts
Worker operations
- Worker scheduler
apps/worker/src/worker.ts - Payment executor
apps/worker/src/executor.ts - Payment reconciliation
apps/worker/src/reconciler.ts - Audit anchoring
apps/worker/src/anchor.ts
Persistence and chain
- Postgres state
packages/db/src/schema.ts - JobVault on Arc
Other components
- Job owner
- AI agent
- x402 seller
- Circle wallets
Connections 30
- Job owner → Web console: configures jobs
README.md - AI agent → MCP tools: uses tools
README.md - MCP tools → Agent API client: calls
apps/mcp/src/server.ts - Agent API client → HTTP API: requests spend
apps/mcp/src/client.ts - Web console → HTTP API: manages jobs
- Job owner → HTTP API: signs approvals
README.md - HTTP API → Key and sign-in auth: authenticates
apps/api/src/services/auth.ts - HTTP API → Owner console services: serves console
apps/api/src/app.ts - HTTP API → Spend and reservation: requests spend
apps/api/src/app.ts - HTTP API → Payment approvals: routes decisions
apps/api/src/app.ts - Spend and reservation → Spend policy: checks rules
README.md - Spend and reservation → Postgres state: reserves funds
README.md - Spend and reservation → Payment integrations: requests payment
README.md - AI agent → AI operator: provides job brief
- AI operator → Model providers: queries model
apps/operator/src/operator.ts - AI operator → Agent API client: uses Bursar API
- Payment integrations → Seller storefront: requests paid resource
README.md - Seller storefront → x402 seller: serves products
apps/seller/src/app.ts - Worker scheduler → Payment executor: runs execution
apps/worker/src/worker.ts - Payment executor → Payment integrations: uses integrations
apps/worker/src/executor.ts - Payment executor → Spend policy: checks rules
apps/worker/src/executor.ts - Payment executor → Postgres state: reads and writes
apps/worker/src/executor.ts - Worker scheduler → Payment reconciliation: runs reconciliation
apps/worker/src/worker.ts - Payment reconciliation → JobVault on Arc: checks chain outcome
README.md - Worker scheduler → Audit anchoring: anchors evidence
README.md - Audit anchoring → JobVault on Arc: anchors on Arc
README.md - Payment executor → Circle wallets: funds payments
README.md - JobVault on Arc → x402 seller: releases payment
README.md - Payment approvals → JobVault on Arc: verifies signature
README.md - Worker scheduler → AI operator: runs autopilot
apps/worker/src/worker.ts