This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Detour Cloud — a white-label reseller of ElizaOS Cloud (flat 20% markup). It
has a completely custom dashboard/frontend, but the backend "plumbing" is
vendored from the elizaOS monorepo and proxied to ElizaCloud's deployed
infra (agent execution, gateways, containers — we don't run our own). dtour's
own data + auth live in self-hosted Convex. Token: $DTOUR (Solana SPL
DijmsEDeTXsWCkCLkhYJNTutKaHf541xZshVrCUbcozy), domain detour.ninja.
Any frontend/UI task MUST follow DESIGN.md at the repo root — it is the source
of truth for colors, type, spacing, radii, motion, and component recipes (dark
glass, violet→indigo→blue accent, white-pill actions, Inter). Do not invent
tokens outside it.
bun run dev # Vite dev server (frontend) → http://localhost:5174
bun run build # Vite production build
bun run typecheck:shared # tsc the vendored cloud-shared (also :api :sdk :routing)
./node_modules/.bin/tsc --noEmit -p packages/cloud-api/tsconfig.json # any vendored pkg
./scripts/setup.sh # recreate eliza symlinks + bun install (run after fresh clone)
./scripts/convex-selfhost.sh # stand up self-hosted Convex (Docker) + print admin key
bunx convex dev # push convex/ functions to the self-hosted backend + gen types
bunx convex run auth:getNonce # invoke a deployed function
bunx convex env set SOLANA_RPC_URL <url> # set a deployment env varThere is no test runner wired up yet. Vendored packages carry upstream tests but aren't run here.
- Vendored backend (
packages/cloud-api,cloud-shared,cloud-sdk,cloud-routing,security): copied byte-identical from the elizaOS monorepo so fixes can be PR'd back upstream. cloud-api is a Hono app on Cloudflare Workers; routes are file-based (<dir>/route.ts→/api/<dir>) and compiled intosrc/_router.generated.tsbynode src/_generate-router.mjs(bun run codegen). Run codegen after adding/removing a route. - Linked elizaOS runtime (
@elizaos/core,shared,ui,plugin-*): NOT vendored. Resolved via symlinks (packages/{core,shared,ui,contracts},plugins/) into a local elizaOS checkout at/Users/home/Documents/milady/eliza(develop branch). This is why the repo is not portable without that checkout —scripts/setup.shrecreates the links. Third-party deps install normally;@elizaos/*resolve via tsconfigpaths, never node_modules. - Self-hosted Convex (
convex/): dtour's own backend — the $DTOUR token gate (nonce + SIWS verify + on-chain balance,gate.tsis a"use node"action), sessions, and user profiles. See "Auth" below. - Custom frontend (
src/,index.html,vite.config.ts): Vite 8 + React 19 + react-router-dom 7 + Tailwind v4. The dashboard shell (src/dashboard/dtour-dashboard-page.tsx) is the central hub; features get added one surface at a time (catalog:docs/elizacloud-surfaces.md).
/login connects a Solana wallet → convex auth.getNonce (single-use nonce) →
SIWS sign → convex gate.verify (consumes nonce, verifies signature, reads
on-chain $DTOUR balance via SOLANA_RPC_URL) → issues a session token
(localStorage dtour-session) only if balance > 0 → routes to /onboarding
(username + email → profiles.save) or /dashboard. RequireSession guards
the dashboard. ElizaCloud's Steward OAuth/wallet login is deliberately replaced;
StewardProvider is a harmless stub.
- Keep vendored
packages/cloud-*byte-identical to upstream. Put all dtour wiring in OUTER files (rootpackage.json,tsconfig.json, symlinks) — never edit vendored.tsto make the build work. Verify withdiff -rq -x node_modules -x dist <eliza>/packages/<pkg> packages/<pkg>. - Root
tsconfig.jsonmust NOT setbaseUrl— it breaks cloud-api's relativepaths(caused 3000+ phantom errors). Vendored configs resolve@elizaos/*to monorepo source via the symlinks. - cloud-api resolves
@elizaos/plugin-elizacloudvia its builtdist(only @elizaos import without a tsconfig src-path). If itsdist/node/index.d.tsshim is missing, runbun run build.tsin that plugin (setup.sh does this). Do NOT point cloud-api at the plugin src — it cascades 48 spurious errors. - Frontend uses Convex
anyApi(fromconvex/server), so it builds WITHOUTconvex/_generated/(which only exists afterbunx convex dev). - Vite 8 + Solana wallets:
vite-plugin-node-polyfillsis incompatible with Vite 8 (rolldown). Use the hand-rolledsrc/polyfills.ts(Buffer shim, imported first inmain.tsx) +define: { global: "globalThis" }. - Tailwind v4 is scoped with
@import "tailwindcss" source(none)+@sourceinsrc/globals.cssso it doesn't scan the symlinked monorepo. - Machine-specific symlinks (
/plugins,/packages/{core,shared,ui,contracts}),node_modules,convex/_generated,docker-compose.yml, and.env.localare gitignored. Vendoredcloud-*packages ARE tracked.