Public
Autonomous agent worker: bid, execute, track payments
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Autonomous AI agent that discovers paid tasks from a marketplace registry, scores them by fit, bids/claims, executes work autonomously, submits deliverables, and tracks escrow/payments with reputation tracking.
┌─────────────────────────────────────────────────┐
│ worker.ts (interval) │
│ Runs every 15 min → triggers runAgentCycle() │
└──────────────────────┬──────────────────────────┘
│
▼
┌──────────────────────────────────────────────────┐
│ agent.ts (core loop) │
│ discover → score → bid/claim → execute → submit │
│ → track payment → update reputation → log │
└──────┬───────┬───────┬───────┬───────┬───────────┘
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
marketplace scoring executor SQLite schema.ts
.ts .ts .ts (logs, tasks,
(discover) (rank) (produce bids, payments,
deliver- reputation)
ables)
┌──────────────────────────────────────────────────┐
│ main.ts (HTTP dashboard) │
│ GET /status — agent overview │
│ GET /tasks — all discovered tasks │
│ GET /scores — task fit scores │
│ GET /bids — bid history │
│ GET /deliverables — submitted work │
│ GET /payments — escrow & payment records │
│ GET /logs — audit trail │
│ GET /reputation — score & earnings │
│ POST /cycle — trigger a cycle manually │
└──────────────────────────────────────────────────┘
| File | Type | Purpose |
|---|---|---|
types.ts | script | Shared TypeScript interfaces |
config.ts | script | Category weights, skill keywords, decision thresholds |
schema.ts | script | SQLite table creation + seeding |
marketplace.ts | script | Task discovery (mock registry or external URL via MARKETPLACE_URL env) |
scoring.ts | script | Fit scoring engine: skill match + time risk + payout + confidence |
executor.ts | script | Per-category execution handlers producing JSON deliverables |
agent.ts | script | Core loop: discover → score → bid/claim → execute → submit → track |
main.ts | http | JSON dashboard API |
worker.ts | interval | Auto-runs the cycle every 15 minutes |
Each discovered task is scored 0–100:
| Factor | Weight | Description |
|---|---|---|
| Skill match | 40% | Required skills ∩ agent keywords + category weight |
| Confidence | 30% | Skill match × 50% + time safety × 30% + escrow bonus |
| Payout | 30% | Budget normalized to 0–1 (capped at $150) |
Decision thresholds:
< 55 fitor< 60 confidenceor< $10 budget→ skip70–79 fit→ bid (place bid, wait for acceptance)≥ 80 fit→ claim (claim directly, execute immediately)
api-integration · automation · backend · copywriting · data-cleaning · frontend · mcp · qa-testing · scraping · web-design · webhook
- tasks — discovered tasks with status tracking
- bids — bid records with pending/accepted/rejected status
- deliverables — submitted work with verification state
- payments — escrow hold → release → paid lifecycle
- reputation — cumulative score (0–1000), earnings, completion stats
- agent_logs — full audit trail of every action
- scores — persisted task fit scores for analysis
Set MARKETPLACE_URL env var to fetch tasks from a live registry instead of mock data:
👉 Add MARKETPLACE_URL here: https://www.val.town/x/kowesip967/agent-marketplace-worker/environment-variables?key=MARKETPLACE_URL
- Dashboard: see
main.tsendpoint URL from file listing - Trigger cycle:
POSTto the endpoint with path/cycle - Status:
GETto the endpoint with path/status
Task claimed with escrow → escrow_held
→ Deliverable submitted → auto-verified
→ escrow_released → paid
→ reputation += 10, earnings += budget
Tasks without escrow go straight to paid after verification.