Repository navigation
Add Cloud Agent development environment - #10
Merged
Merged
Conversation
Configure .cursor/environment.json + install script so Cloud Agents can run and iterate on the app locally: - install: npm ci, apply src/db/schema.sql to the local (miniflare) D1, and create a git-ignored .dev.vars with a local ADMIN_SECRET for the /admin seed routes. - terminals: npx wrangler dev --local on port 8787. --local disables the remote Workers AI binding so dev needs no CLOUDFLARE_API_TOKEN; only the /speak TTS routes are unavailable offline. - ports: expose 8787. Co-authored-by: Kyle Alm <keepkalm@gmail.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
rapbattle | ebd32fd | Sep 26 2026, 05:30 PM |
keepkalm
marked this pull request as ready for review
September 26, 2026 17:27
Co-authored-by: Kyle Alm <keepkalm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Cloud Agent development environment so agents can run, test, and iterate on the rapbattle Cloudflare Worker locally.
.cursor/environment.json—install, awrangler devterminal, and exposed port8787..cursor/install.sh— idempotent bootstrap.This is a repository-managed environment: once merged to
main, Cloud Agents pick it up automatically (it also follows branches/PRs).How it works
The app is a single Cloudflare Worker (D1 + R2 + KV + Workers AI + a bound-but-unused Durable Object). Local dev runs on
wrangler dev --local, which emulates D1/R2/KV/DO in-process (miniflare).npm ci(lockfile-pinned, matching the typecheck CI), then appliessrc/db/schema.sqlto the local D1 so the base tables exist (ensureSchema()insrc/beats.tsonly adds the auxiliary tables/columns at runtime). It also writes a git-ignored.dev.varswith a localADMIN_SECRETso the/admin/*seed routes work offline.npx wrangler dev --local --ip 0.0.0.0 --port 8787. The--localflag disables the remote Workers AI binding, so dev needs noCLOUDFLARE_API_TOKEN. The only feature unavailable offline is/speakTTS audio (Workers AI has no local emulator).8787.Verification
Ran on the setup VM:
npm cinpm run typecheck(tsc --noEmit)wrangler dev --localboot:8787, all bindings localGET /health{"status":"live",...}GET /home pagePOST /admin/seed-rift(D1 write){"status":"ok",...}/battle/battle-001,/leaderboard,/stage(D1 read)Prebuilt-environment build + fresh-agent verification:
installfrom fresh checkout)/health, D1 write (seed-rift) + D1 reads all passedDemo of the running arena rendering real seeded data:
rapbattle-demo.mp4
Home page
Battle page with Rift
Notes
.dev.varsholds only a local, non-production dev secret and stays git-ignored.README.md; this only affects local dev.To show artifacts inline, enable in settings.