Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
docs(tutorials): two new tutorials + content edits, nav polish
nirholasb30ed73c75af
diff --git a/docs/tutorials/customize-appearance.md b/docs/tutorials/customize-appearance.mdindex 36ceeb09c..a5697743f 100644--- a/docs/tutorials/customize-appearance.md+++ b/docs/tutorials/customize-appearance.md@@ -365,7 +365,7 @@ A note for engineers: the script element itself exposes a small JS API for cases<script>const agentScript = document.getElementById('agent-script');- agentScript.addEventListener('ready', () => {+ agentScript.addEventListener('agent:ready', () => {// The agent is fully loaded and visibleagentScript.playAnimationByHint('wave');});diff --git a/docs/tutorials/deploy-to-vercel-custom-domain.md b/docs/tutorials/deploy-to-vercel-custom-domain.mdnew file mode 100644index 000000000..cf41951ac--- /dev/null+++ b/docs/tutorials/deploy-to-vercel-custom-domain.md@@ -0,0 +1,508 @@+# Deploy to Vercel with a Custom Domain++By the end of this tutorial you have a live three.ws fork running at a domain you own — `agent.yourcompany.com` or whatever you choose. CI is wired so every commit type-checks, every PR generates a preview, and merges to `main` ship to production. SSL is issued automatically. Rollbacks take one click.++This is the deployment-side companion to [self-host-agent-backend](/tutorials/self-host-agent-backend). That tutorial covered the architectural moving parts; this one walks the deploy and operate flow end-to-end without re-explaining what each component does.++**What you'll build:**++- A Vercel project linked to your fork of `three.ws`+- A working `vercel.json` (the repo's default works, but you'll know what's in it)+- Three environments — `development` (local), `preview` (per PR), `production` (your domain)+- A custom domain wired with DNS and automatic SSL+- A GitHub Actions workflow for type checks and tests on every PR+- Promotion mechanics: how preview becomes production+- Analytics, error tracking, and a rollback procedure+- The cost shape: what you should expect to pay++**Prerequisites:**++- A fork of the `three.ws` repo. If you haven't forked yet, see [self-host-agent-backend](/tutorials/self-host-agent-backend) Step 2.+- A Vercel account (free tier is enough to start)+- A domain you control. New domains can be bought from any registrar — Cloudflare, Namecheap, Porkbun, or Vercel itself+- Node.js 24.x locally for verifying builds before deploying+- Access to your domain's DNS provider (the registrar's panel or, more commonly, Cloudflare DNS)+- Optional: Sentry account for error tracking, a Postgres instance (Neon, Vercel Postgres, Supabase), Upstash Redis. None are required for the bare deploy — you'll add them as needed++---++## Step 1 — One-line deploy first, then the deeper config++Get something live in five minutes. Open a terminal inside your fork:++```bash+cd three.ws+npm i -g vercel+vercel login+vercel link+```++When `vercel link` asks "Set up and deploy?", answer yes, accept the default project name (your repo name), accept the suggested team/scope, and accept the auto-detected framework settings — Vercel will detect Vite from `package.json`.++```bash+vercel+```++Vercel installs deps, runs `npm run build`, and deploys a preview. After about three minutes you'll get a URL like `https://three-ws-yourname.vercel.app`. Hit `/api/healthz`. You should see `{"ok": true}` or similar — the platform is live, even if every other route 404s or 500s because env vars aren't set yet.++That's the floor. From here every change is incremental.++---++## Step 2 — What's in `vercel.json`++The repo ships a `vercel.json`. Read it once so you know what's working for you. The interesting parts:++```json+{+ "buildCommand": "npm run build:vercel",+ "outputDirectory": "dist",+ "public": true,+ "installCommand": "npm ci --prefer-offline --no-audit --no-fund",+ "env": { "NODE_OPTIONS": "--no-deprecation" },+ "functions": {+ "api/**/*.js": { "includeFiles": "node_modules/@zauthx402/sdk/dist/**" }+ },+ "routes": [+ { "src": "/openapi\\.json", "dest": "/api/openapi-json" },+ { "src": "/\\.well-known/chat-plugin\\.json", "dest": "/api/wk?name=chat-plugin" },+ { "src": "/\\.well-known/x402\\.json", "dest": "/api/wk?name=x402-discovery" }+ ]+}+```++Three things worth understanding:++- **`buildCommand: npm run build:vercel`** runs the production build, including the prebuild step that generates the page index. The local `npm run dev` uses Vite directly; `build:vercel` is the optimized path that ships.+- **`outputDirectory: dist`** is what Vercel serves as static files. After `npm run build`, `dist/` contains `index.html`, hashed JS bundles, the `cdn/` folder, sub-apps under `dist/chat/`, etc.+- **`routes`** rewrites specific paths to specific function files. The well-known routes (`/.well-known/x402.json` → `/api/wk?name=x402-discovery`) are how the platform exposes machine-readable discovery surfaces at the URLs the spec mandates.++You shouldn't need to edit `vercel.json` for the basic deploy. The repo's defaults are tuned for the platform's actual route set.++---++## Step 3 — Set environment variables++The deploy at Step 1 has no env vars. Almost every API route will fail. Add them.++In your terminal:++```bash+vercel env add DATABASE_URL production+vercel env add ANTHROPIC_API_KEY production+vercel env add OPENAI_API_KEY production+vercel env add SOLANA_RPC_URL production+vercel env add SESSION_SECRET production # openssl rand -hex 32+vercel env add CSRF_SECRET production # openssl rand -hex 32+vercel env add X402_PAY_TO_BASE production+vercel env add X402_ASSET_ADDRESS_BASE production # 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base mainnet+vercel env add CDP_API_KEY_ID production+vercel env add CDP_API_KEY_SECRET production+# Object storage+vercel env add R2_ENDPOINT production+vercel env add R2_BUCKET production+vercel env add R2_ACCESS_KEY_ID production+vercel env add R2_SECRET_ACCESS_KEY production+vercel env add R2_PUBLIC_BASE production+# Optional but recommended once you have traffic+vercel env add UPSTASH_REDIS_REST_URL production+vercel env add UPSTASH_REDIS_REST_TOKEN production+vercel env add HELIUS_API_KEY production+```++The complete list is in `.env.example` in the repo. For an exhaustive walkthrough of what each variable does, see [self-host-agent-backend](/tutorials/self-host-agent-backend).++Repeat for the `preview` and `development` environments where you want different values. Most secrets you'll want **different per environment** — production must have its own `SESSION_SECRET`, its own `X402_PAY_TO_BASE` (so receipts are attributable to the right environment), and ideally its own `ANTHROPIC_API_KEY` (so a runaway preview deploy can't drain your production budget).++For variables that have to be set at build time (not runtime), prefix them with `VITE_`:++```bash+vercel env add VITE_API_BASE production # https://agent.yourcompany.com+vercel env add VITE_CDN_BASE production # https://agent.yourcompany.com+```++Triggering a fresh deploy picks up the new env:++```bash+vercel --prod+```++---++## Step 4 — Connect the GitHub repo++So you don't have to `vercel --prod` from your laptop forever, hook up automatic deploys from GitHub.++In the Vercel dashboard:++1. Open your project → **Settings → Git**+2. Click **Connect Git Repository**+3. Authorize Vercel to read your fork+4. Pick your fork from the list++Vercel sets up two integrations:++- **Production deploys** trigger on pushes to the production branch (default: `main`)+- **Preview deploys** trigger on every other branch and every pull request, each getting its own URL++From this point: `git push origin main` ships to production, opens-a-PR ships a preview. You won't run `vercel --prod` from local again.++A subtle but useful Vercel feature: each PR's preview URL is also added as a comment on the PR by the Vercel GitHub app. The comment updates as new commits ship. Reviewers click the URL and exercise the change.++---++## Step 5 — Add a custom domain++In the Vercel dashboard: **Project → Settings → Domains → Add**. Type your domain (e.g., `agent.yourcompany.com`) and submit.++Vercel shows DNS instructions. Two cases:++**Subdomain (most common).** Vercel asks for a `CNAME` record pointing your subdomain at `cname.vercel-dns.com`. Add this record in your DNS provider:++| Type | Name | Value | TTL |+|-------|--------|------------------------|--------|+| CNAME | agent | cname.vercel-dns.com. | 300 |++Save. Wait. DNS propagation typically takes 1–10 minutes but can take up to 24 hours. Vercel's domains UI shows a green check once it sees the record.++**Apex / root domain (e.g., `yourcompany.com`).** Apex domains can't use CNAME records (per DNS RFCs). Vercel provides A records or, on supporting providers, ALIAS records:++| Type | Name | Value | TTL |+|------|------|-----------------|-----|+| A | @ | 76.76.21.21 | 300 |++(Vercel's published IPs may change; copy the exact values from the dashboard.)++If your DNS is on Cloudflare, set the proxy status to **DNS only** (gray cloud), not proxied (orange cloud). Cloudflare's proxy in front of Vercel breaks the auto-SSL handshake and double-caches. Vercel's edge handles caching; you don't need Cloudflare's on top.++Once DNS resolves, Vercel automatically requests a Let's Encrypt certificate and installs it. HTTPS works without any configuration on your side. Confirm:++```bash+curl -I https://agent.yourcompany.com/api/healthz+```++You should see `HTTP/2 200`. If you see `525` or `526` errors, DNS hasn't fully propagated. Wait 10 more minutes.++**Redirect www to apex (or vice versa).** If you want both `agent.yourcompany.com` and `www.agent.yourcompany.com` to resolve, add the `www` variant in Vercel's Domains UI too. Vercel will let you set one as primary and 301 the other to it.++---++## Step 6 — Set the production branch++Vercel defaults the production branch to `main`. Verify in **Settings → Git → Production Branch**.++If you use Git Flow or trunk-based with a different production branch (e.g., `production` or `release`), change it here. The setting is per-project; you can't accidentally ship `feat/foo` to production unless you push it to whichever branch is set.++---++## Step 7 — GitHub Actions for type checks and tests++Vercel's build catches build errors but not type errors that pass through the build (TypeScript with `--noEmit` skipped, or JSDoc errors). Add a CI workflow that catches them.++Create `.github/workflows/ci.yml`:++```yaml+name: CI+on:+ pull_request:+ branches: [main]+ push:+ branches: [main]++jobs:+ test:+ runs-on: ubuntu-latest+ timeout-minutes: 15+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with:+ node-version: '24'+ cache: 'npm'+ - run: npm ci --prefer-offline --no-audit --no-fund+ - run: npm run typecheck+ - run: npm test+ - run: npm run build:vercel+```++The repo already exposes `typecheck`, `test`, and `build:vercel` scripts in `package.json`. If your fork has additional checks (lint, format), add them as separate steps.++Wire required status checks: **Repo Settings → Branches → Add rule → Branch name `main` → Require status checks → Add `CI / test`**. Now no PR merges without CI green.++For larger forks, parallelize:++```yaml+ typecheck:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with: { node-version: '24', cache: 'npm' }+ - run: npm ci --prefer-offline --no-audit --no-fund+ - run: npm run typecheck++ test:+ runs-on: ubuntu-latest+ steps:+ - uses: actions/checkout@v4+ - uses: actions/setup-node@v4+ with: { node-version: '24', cache: 'npm' }+ - run: npm ci --prefer-offline --no-audit --no-fund+ - run: npm test+```++Two jobs, run in parallel. Most teams add a third job for a smoke test against the Vercel preview URL; see Step 11.++---++## Step 8 — Environment promotion++You have three environments now:++| Environment | Trigger | URL pattern | Env vars source |+|-------------|--------------------------|--------------------------------------------------|-----------------|+| Development | `npm run dev` locally | `http://localhost:3000` | `.env.development` (gitignored) |+| Preview | Push any non-prod branch | `https://three-ws-<hash>-yourname.vercel.app` | Vercel `preview` env scope |+| Production | Push to `main` | `https://agent.yourcompany.com` | Vercel `production` env scope |++The promotion path is **dev → preview → production**. Every change rides this path:++1. Write code locally. `npm run dev`. Hit `http://localhost:3000`. Confirm behavior.+2. Push a branch and open a PR. CI runs. Vercel's GitHub bot comments with a preview URL. You and reviewers smoke-test the preview.+3. Merge to `main`. Vercel auto-deploys to production. Production traffic now hits the new build.++If preview surfaces a bug, you fix on the same branch and push — the same preview URL updates. No redeploy ceremony.++**Don't ever `vercel --prod` from local once GitHub integration is wired.** It bypasses CI. Lock yourself out of the temptation: revoke your local CLI's permission to push prod via **Settings → Security → Deploy Hooks → Disable interactive deploys**.++---++## Step 9 — Analytics++The Vercel free tier ships **Web Analytics** (privacy-friendly, no-cookie, ~1KB script). Enable it: **Project → Analytics → Enable**. The script auto-injects into your pages.++For richer product analytics, options:++- **Plausible (self-hosted or hosted).** Add the script tag to `index.html`.+- **PostHog.** Same. PostHog's free tier covers most early-stage usage.+- **Custom.** The platform has a `/api/usage` route used for internal telemetry; wire your own events there.++Don't try to instrument both Vercel Analytics and a heavy SDK like Segment without thinking about it — you'll double-count page views and confuse yourself. Pick one source of truth for product metrics. Vercel Analytics is the cheapest start.++For agent-specific events (chat messages sent, skills invoked, x402 payments completed), the platform's `audit_log` table is your source — query it via your admin tool of choice (Metabase, Grafana, or a custom dashboard route).++---++## Step 10 — Error tracking++`console.error` in a Vercel function disappears into the deployment logs, where it's only useful if you happen to check at the right moment. Set up a real error tracker.++Sentry has the cleanest Vercel integration. From the Vercel dashboard:++1. **Marketplace → Sentry → Add Integration**+2. Authorize, pick your Sentry project, finish+3. Sentry's wizard generates env vars (`SENTRY_DSN`, etc.) and adds them to your Vercel project automatically++Now add Sentry to the code. For the back-end functions:++```bash+npm install @sentry/node+```++```js+// api/_lib/sentry.js+import * as Sentry from '@sentry/node';++if (process.env.SENTRY_DSN) {+ Sentry.init({+ dsn: process.env.SENTRY_DSN,+ environment: process.env.VERCEL_ENV || 'production',+ tracesSampleRate: 0.1,+ });+}++export function captureError(err, extra = {}) {+ if (process.env.SENTRY_DSN) {+ Sentry.captureException(err, { extra });+ } else {+ console.error('captureError', err, extra);+ }+}+```++The platform already has a `_lib/sentry.js` you can extend. The pattern: every Vercel function's error path calls `captureError`. Don't sample those down — errors are rare and you want all of them.++For the front-end:++```bash+npm install @sentry/browser+```++```js+// src/sentry-bootstrap.js+import * as Sentry from '@sentry/browser';+if (import.meta.env.PROD && import.meta.env.VITE_SENTRY_DSN) {+ Sentry.init({+ dsn: import.meta.env.VITE_SENTRY_DSN,+ environment: import.meta.env.MODE,+ tracesSampleRate: 0.05,+ });+}+```++Import this from your app entrypoint. Now front-end errors (Three.js initialization failures, manifest load errors, network errors in the chat) also flow to Sentry.++Set up a Sentry alert: "any new issue (first seen in last 24h) in production environment" → page someone. The signal-to-noise on this alert is excellent for a small platform.++---++## Step 11 — Smoke tests against preview++A great CI step is exercising the preview URL after Vercel deploys it. Add to `.github/workflows/ci.yml`:++```yaml+ smoke:+ runs-on: ubuntu-latest+ needs: test+ if: github.event_name == 'pull_request'+ steps:+ - uses: actions/checkout@v4+ - name: Wait for Vercel preview+ id: wait+ uses: patrickedqvist/[email protected]+ with:+ token: ${{ secrets.GITHUB_TOKEN }}+ max_timeout: 300+ - name: Smoke test+ env:+ PREVIEW_URL: ${{ steps.wait.outputs.url }}+ run: |+ set -e+ curl -fsS "$PREVIEW_URL/api/healthz" | tee /tmp/health.json+ test "$(jq -r .ok /tmp/health.json)" = "true"+ curl -fsS -I "$PREVIEW_URL/" | head -1 | grep -q "200"+ curl -fsS -I "$PREVIEW_URL/cdn/agent-3d.js" | head -1 | grep -q "200"+```++Three checks: the health endpoint responds, the home page returns 200, the CDN bundle exists. If any fail, the PR's CI goes red. Add more checks as you find behaviors worth gating on.++For deeper smoke tests, point Playwright at the preview URL:++```yaml+ - name: Playwright smoke+ env:+ BASE_URL: ${{ steps.wait.outputs.url }}+ run: |+ npm ci+ npx playwright install --with-deps chromium+ npm run test:smoke+```++Where `test:smoke` runs a small Playwright suite that loads an agent, sends a chat message, and asserts a response comes back. The platform's `tests/e2e/` directory has examples.++---++## Step 12 — Rollback++Despite all the CI, you will ship a regression. The fix is fast.++**Option A: rollback via the Vercel dashboard.** Project → Deployments → find the last good deployment → click `...` → **Promote to Production**. Done. The DNS at `agent.yourcompany.com` flips to the older build in seconds. You can then debug at your leisure on a new branch.++**Option B: rollback via git.** Revert the bad commit on `main`, push. CI runs and the production build deploys with the revert applied. This is slower than option A but leaves a clean git history.++**Option C: rollback specific routes.** Vercel doesn't natively support per-route rollback, but if the bad change is in a single function, you can patch that function in a tiny commit and ship just it. Same as option B with a smaller diff.++Whatever you do, **don't redeploy in panic**. Take the rollback first, then investigate. Production is back up; you can debug calmly.++---++## Step 13 — Branch protection (the boring but vital settings)++In your GitHub repo: **Settings → Branches → Add rule** for `main`:++- Require pull request reviews before merging+- Require status checks to pass before merging (select `CI / test` and `CI / smoke` if you wired the smoke step)+- Require branches to be up to date before merging+- Do not allow bypassing the above settings (even for admins)++For higher-stakes deployments (multi-person teams, customer-facing platform), also enable:++- Require signed commits+- Require linear history (no merge commits — squashes or rebases only)+- Restrict who can push to `main` (only Vercel's GitHub app + named release engineers)++These rules are annoying when you're the only contributor. They are load-bearing once the team grows past one person.++---++## Step 14 — Production checklist++Before you call it done:++- DNS resolves and SSL works for your custom domain+- `/api/healthz` returns 200+- A test agent can be created in the dashboard, edited, and embedded on a third-party page+- The CDN bundle at `https://agent.yourcompany.com/cdn/agent-3d.js` serves correctly with `Cache-Control` and a hashed/versioned filename in the source map+- GitHub → Vercel integration is live; pushing to `main` triggers a production deploy and pushing a branch triggers a preview+- CI passes on a recent PR and the preview URL is reachable+- Sentry receives a deliberately thrown error from a preview deploy (test once, then remove the test)+- Vercel Analytics is enabled and shows page views in the dashboard within a few minutes of opening the site+- Branch protection rules are on `main`+- Rollback procedure is documented in your team's runbook (one line is enough: "Vercel → Deployments → Promote to Production")+- At least one team member other than the deployer can perform the rollback+- DNS TTL is set to 300 seconds (not 86400) so a rollback that involves DNS changes propagates quickly++---++## Step 15 — Cost shape++Roughly what to expect:++- **Vercel.** Free tier (Hobby) covers small projects — 100 GB-hours of serverless execution, 100 GB bandwidth, unlimited static. Pro starts at $20/seat/month with much higher limits. The lever that moves you off free is bandwidth (the CDN bundle plus model files are weighty).+- **Database.** Neon free tier is enough for <1 GB. $19/month buys you the next tier with multi-branch databases and longer history. Vercel Postgres is comparable. Supabase free tier is more generous than either if you don't need branches.+- **Redis (Upstash).** Free tier covers tens of thousands of requests per day. $0.20 per 100k requests beyond.+- **R2 / object storage.** Cloudflare R2 is ~$15/TB/month with zero egress. AWS S3 is ~$23/TB/month plus egress, which matters once you serve avatars from it. Pick R2 unless you have a strong AWS reason.+- **LLM tokens.** Order of magnitude bigger than infrastructure for any agent that gets used. Anthropic Sonnet at the time of writing is ~$3 per million input tokens and $15 per million output. A typical chat message round trip is 3,000–8,000 tokens. Do the multiplication for your traffic.+- **Solana RPC.** Helius free covers significant usage; $50/month for production tiers.+- **CDP.** No charge for facilitator usage itself; you pay gas on settle (covered by the buyer, not you).+- **Domain.** $10–15/year for a `.com`. Less for `.dev`, more for premium TLDs.++A real small-scale deployment: ~$25/month infrastructure floor + variable LLM tokens. A real medium-scale deployment with 10k visitors/month: ~$200/month infrastructure + likely $500–1500/month in LLM tokens. The infra side scales linearly and predictably; the LLM side scales with engagement and is the lever where pricing decisions actually matter.++---++## Step 16 — Things that will go wrong++In rough order of likelihood:++**The build breaks because Node version drifts.** Confirm `engines.node` in `package.json` matches what Vercel installs. The repo pins to `24.x`; Vercel respects this. If it ever stops, set `NODE_VERSION=24` in your project's env vars (build-time scope).++**A migration runs out of order.** Your `migrations/` directory is the source of truth — if two engineers add migrations on parallel branches, the lexically-earlier one applies first regardless of merge order. The fix: timestamp filenames (`20260514120000_add_x.sql`), don't number them (`002_add_x.sql`).++**The CDN bundle gets stale at edges.** Vercel's edge respects `Cache-Control` headers. Make sure your build emits hashed filenames (`agent-3d.<hash>.js`) and your script tag references the canonical URL that always rewrites to the latest hash. The repo handles this; if you customize the build pipeline, don't break the hashing.++**Cold starts spike.** Some serverless functions hit a cold start every few minutes if traffic is sparse. The fix: a `cron` that hits `/api/healthz` every 5 minutes from a scheduled GitHub Action or an external uptime monitor (Better Uptime, Pingdom, or just a `cron-job.org`-style free service).++**SSL renewal fails.** Vercel renews Let's Encrypt certs automatically. Failures are extremely rare. If you do see a cert error, check the domain still resolves correctly — failures almost always trace back to DNS changes you forgot to make.++**A preview deploy leaks production data.** The preview environment shares a database with production unless you wire it to a separate one. Use Neon's branch databases, or set a different `DATABASE_URL` in the `preview` env scope. The cleanest pattern: preview has its own database, seeded from a sanitized snapshot of production.++---++## What you learned++- The repo's existing `vercel.json` and how its routes map to functions+- The env-vars setup for three environments and the rationale for separating them+- DNS + SSL for a custom subdomain or apex+- A CI workflow that gates merges on type checks, tests, and a smoke test against the preview URL+- Production promotion via merge to `main`, never `vercel --prod` from local+- Analytics, error tracking, and the right alerts to set+- Rollback procedure (one click) and branch protection+- The cost shape so you can budget realistically++## Next steps++- The deeper architectural tour of what's running on the deployment — [self-host-agent-backend](/tutorials/self-host-agent-backend)+- Make sure your embed code points at your domain, not the upstream — [embed-on-website](/tutorials/embed-on-website)+- Add a paid endpoint and route revenue to a wallet you control — [paid-x402-endpoint](/tutorials/paid-x402-endpoint)+- Expose your agent as an MCP server from your domain — [mcp-server-for-your-agent](/tutorials/mcp-server-for-your-agent)diff --git a/docs/tutorials/embed-in-30-seconds.md b/docs/tutorials/embed-in-30-seconds.mdindex 44bf09521..74e9983ca 100644--- a/docs/tutorials/embed-in-30-seconds.md+++ b/docs/tutorials/embed-in-30-seconds.md@@ -115,7 +115,7 @@ When the browser hits this line:4. It injects a container element into the page (by default, fixed to the bottom-right corner) and renders the 3D scene inside it.-5. Once the avatar is loaded, the script dispatches a `ready` event you can listen to. The agent then begins its idle animation and waits for interaction.+5. Once the avatar is loaded, the script dispatches a `agent:ready` event you can listen to. The agent then begins its idle animation and waits for interaction.Notice what is *not* on this list:- No iframe. The agent renders directly in your page's DOM, which means it inherits your site's CSS scope intentionally (we'll cover styling shadows in the customisation tutorial).diff --git a/docs/tutorials/greeting-and-first-speech.md b/docs/tutorials/greeting-and-first-speech.mdindex 11b0a7e41..f61948d5a 100644--- a/docs/tutorials/greeting-and-first-speech.md+++ b/docs/tutorials/greeting-and-first-speech.md@@ -37,7 +37,7 @@ This works. Most embed installations should ship with a greeting attribute. The## Step 2 — When the greeting fires-The embed dispatches a `ready` event on the script element once the avatar is loaded, the camera is positioned, the lighting is set, and the voice subsystem is initialised. The greeting fires on that event automatically when the `data-greeting` attribute is set.+The embed dispatches a `agent:ready` event on the script element once the avatar is loaded, the camera is positioned, the lighting is set, and the voice subsystem is initialised. The greeting fires on that event automatically when the `data-greeting` attribute is set.In rough terms, the timing on a typical broadband connection is:@@ -45,7 +45,7 @@ In rough terms, the timing on a typical broadband connection is:2. **0–500 ms** — `agent-3d.js` is fetched from the CDN and starts running.3. **500–1500 ms** — The agent's manifest is fetched from the platform API.4. **1500–3500 ms** — The GLB body is downloaded and parsed.-5. **3500–4000 ms** — The avatar appears, the scene renders, the `ready` event fires.+5. **3500–4000 ms** — The avatar appears, the scene renders, the `agent:ready` event fires.6. **4000–4500 ms** — The greeting starts speaking. The speech bubble appears.On a fast connection with the bundle cached, this collapses to about two seconds total. On a slow mobile connection, it can stretch to six or seven seconds; the agent fades in gracefully and the greeting fires when ready, so visitors never see a half-loaded character.@@ -62,7 +62,7 @@ If you want to control the timing precisely — say, wait for an extra moment be<script>const agent = document.getElementById('agent-script');- agent.addEventListener('ready', async () => {+ agent.addEventListener('agent:ready', async () => {// Wait two seconds after the agent is visible before speakingawait new Promise(r => setTimeout(r, 2000));agent.speak('Hi, I\'m Iris. Take your time looking around.');@@ -220,14 +220,14 @@ For dynamic greetings, skip `data-greeting` and use the JS API:return `Good ${timeOfDay}. I\'m Iris. Click me to ask anything about our service.`;}- agent.addEventListener('ready', () => {+ agent.addEventListener('agent:ready', () => {agent.speak(pickGreeting());localStorage.setItem('hasVisited', 'yes');});</script>```-The pattern is: skip the attribute, listen for `ready`, choose a greeting in JS, call `speak()`. The visitor always gets a greeting, and the greeting is tailored to what you know about them at page-load time.+The pattern is: skip the attribute, listen for `agent:ready`, choose a greeting in JS, call `speak()`. The visitor always gets a greeting, and the greeting is tailored to what you know about them at page-load time.### Going further: LLM-generated greetings@@ -243,7 +243,7 @@ Then, in your page:```jsconst agent = document.getElementById('agent-script');-agent.addEventListener('ready', () => {+agent.addEventListener('agent:ready', () => {// The agent will process this through its brain and the response will be spokenagent.speak('__greet');});@@ -340,7 +340,7 @@ In practice, problems are almost always step 5 (autoplay rules) or step 6 (voice## What you learned- `data-greeting` is the simplest way to give your agent a spoken first line-- The greeting fires on the `ready` event, automatically and reliably+- The greeting fires on the `agent:ready` event, automatically and reliably- Browser autoplay rules can suppress the audio on first page load; the embed handles this gracefully by always showing the speech bubble and queuing audio for the user's first interaction- A spoken greeting is also a readable greeting — write it to work both ways- The accessibility tooling is built in (ARIA live regions, automatic announcements) but you can layer your own transcript on top using the `speak` eventdiff --git a/docs/tutorials/mint-pumpfun-token.md b/docs/tutorials/mint-pumpfun-token.mdindex 3320a750b..29344a86f 100644--- a/docs/tutorials/mint-pumpfun-token.md+++ b/docs/tutorials/mint-pumpfun-token.md@@ -293,7 +293,7 @@ The response includes the curve account's raw fields plus computed helpers:`graduationProgress` is a float between 0 and 1; multiply by 100 for a percentage. `complete` flips to `true` after graduation and stays there. For a holder count, hit `https://three.ws/api/pump/dashboard?agent=<agentId>`.-If you need raw on-chain reads, point any Solana RPC client at the Pump.fun program ID and decode the curve account with the program's published IDL. The three.ws endpoint is just a convenience layer.+If you need raw on-chain reads, point any Solana RPC client (Helius, Triton, or the public mainnet RPC for low-volume use) at the Pump.fun program ID and decode the bonding curve account with the program's published IDL. The three.ws endpoint is just a normalized, rate-limit-friendly convenience layer over that same on-chain data — every field is derivable yourself if you don't want to depend on the platform.---diff --git a/docs/tutorials/multi-agent-coordination.md b/docs/tutorials/multi-agent-coordination.mdindex 492f85781..7fda1687e 100644--- a/docs/tutorials/multi-agent-coordination.md+++ b/docs/tutorials/multi-agent-coordination.md@@ -17,7 +17,7 @@ This tutorial assumes you've built at least one agent ([first-agent](/tutorials/- Two saved agents in your dashboard at `https://three.ws/dashboard`. They can be variants of the same avatar or two completely different characters.- A live web page where you can drop two `<script>` tags and own the surrounding HTML/JS. A static `.html` file served by `npx serve .` is enough to get started.-- Familiarity with the embed JS API (`speak`, `playAnimation`, events like `chat-message`, `speak-end`, `ready`). The reference is in [js-api-events](/tutorials/js-api-events) and the source of truth is `https://three.ws/cdn/agent-3d.js`.+- Familiarity with the embed JS API (`speak`, `playAnimation`, events like `brain:message`, `voice:speech-end`, `agent:ready`). The reference is in [js-api-events](/tutorials/js-api-events) and the source of truth is `https://three.ws/cdn/agent-3d.js`.- Each agent has a personality configured. See [agent-personality](/tutorials/agent-personality) if either of yours doesn't yet — they need distinct voices for the handoff to feel coherent.---@@ -108,10 +108,10 @@ Replace `<RILEY_AGENT_ID>` and `<DEVON_AGENT_ID>` with the actual agent IDs fromThe coordinator is the small piece of JavaScript on the page that decides which agent speaks. It does five things:-1. **Wait for both agents to be `ready`.** Until then, hold the user's input.+1. **Wait for both agents to be `agent:ready`.** Until then, hold the user's input.2. **Pick a starting agent.** Default: Riley.3. **Route the user's message.** Pass it to the current agent.-4. **Listen for handoff signals.** A handoff is the current agent saying "I'm going to hand you to <other agent>." We detect it from `chat-message` events.+4. **Listen for handoff signals.** A handoff is the current agent saying "I'm going to hand you to <other agent>." We detect it from `brain:message` events.5. **Maintain shared scratch memory.** When a handoff happens, the new agent gets a brief that contains what the previous agent did.Create `coordinator.js`:@@ -157,11 +157,11 @@ function onReady(name, el) {};}-riley.addEventListener('ready', onReady('riley', riley));-devon.addEventListener('ready', onReady('devon', devon));+riley.addEventListener('agent:ready', onReady('riley', riley));+devon.addEventListener('agent:ready', onReady('devon', devon));```-This boots both agents, marks both `ready`, then has Riley introduce the pair. Devon stands by silently.+This boots both agents, marks both `agent:ready`, then has Riley introduce the pair. Devon stands by silently.---@@ -181,11 +181,11 @@ input.addEventListener('keydown', (e) => {});```-The agent's response comes back via the `chat-message` event:+The agent's response comes back via the `brain:message` event:```jsfunction wireMessages(name, el) {- el.addEventListener('chat-message', (e) => {+ el.addEventListener('brain:message', (e) => {const { role, content } = e.detail;if (role === 'assistant' && content) {appendLog(name, content);@@ -304,7 +304,7 @@ function cleanForUser(text) {}function wireMessages(name, el) {- el.addEventListener('chat-message', (e) => {+ el.addEventListener('brain:message', (e) => {const { role, content } = e.detail;if (role !== 'assistant' || !content) return;const cleaned = cleanForUser(content);@@ -321,14 +321,14 @@ The `state.scratch` keeps the raw text (so the brief built in `buildBrief` is fa## Step 8 — Speech-end synchronization-The agent's `speak` method drives the 3D character's lip-sync and ambient animations. The `speak-end` event fires when the avatar finishes saying its line. Use this to gate the next user input:+The agent's `speak` method drives the 3D character's lip-sync and ambient animations. The `voice:speech-end` event fires when the avatar finishes saying its line. Use this to gate the next user input:```jslet speaking = false;function wireSpeechGate(el) {- el.addEventListener('speak-start', () => { speaking = true; input.disabled = true; });- el.addEventListener('speak-end', () => { speaking = false; input.disabled = false; input.focus(); });+ el.addEventListener('voice:speech-start', () => { speaking = true; input.disabled = true; });+ el.addEventListener('voice:speech-end', () => { speaking = false; input.disabled = false; input.focus(); });}wireSpeechGate(riley);wireSpeechGate(devon);@@ -336,7 +336,7 @@ wireSpeechGate(devon);Without this, an eager visitor types over the avatar's spoken response and the conversation tangles. With it, each turn completes cleanly.-For a handoff specifically, you want the OLD agent's `speak-end` to fire *before* the NEW agent starts speaking. The event order is naturally correct because the coordinator calls `targetEl.chat(brief, ...)` immediately, but the new agent doesn't start speaking until its LLM responds — which is well after the old agent finished its last syllable. No extra coordination needed in practice.+For a handoff specifically, you want the OLD agent's `voice:speech-end` to fire *before* the NEW agent starts speaking. The event order is naturally correct because the coordinator calls `targetEl.chat(brief, ...)` immediately, but the new agent doesn't start speaking until its LLM responds — which is well after the old agent finished its last syllable. No extra coordination needed in practice.---@@ -353,7 +353,7 @@ If any of those fail, the typical causes:- **Riley doesn't hand off.** The system prompt isn't strong enough. Make the trigger list more concrete or use few-shot examples in the prompt.- **Devon answers technical questions Riley should have answered.** Check that the handoff topics list in Riley's prompt is *exclusive* — explicitly say "do NOT hand off when the visitor asks X."-- **Both agents speak at once.** The `speak-start`/`speak-end` gate isn't wired, or one of the agents is mis-receiving the chat input. Confirm `state.active` is correctly set and the `chat()` call only goes to `state.active`.+- **Both agents speak at once.** The `voice:speech-start`/`voice:speech-end` gate isn't wired, or one of the agents is mis-receiving the chat input. Confirm `state.active` is correctly set and the `chat()` call only goes to `state.active`.---@@ -458,7 +458,7 @@ The runtime cannot fix prompts that contradict each other. Catch contradictions## Step 13 — Pattern: turn-taking with no human-Sometimes the two agents are talking to each other, with the human watching. A debate, a roleplay, a brainstorm. This is the cleanest pattern in terms of code (no human input gate; turns alternate on `speak-end`) and the hardest pattern in terms of LLM behavior (without grounding in real user input, both agents drift into hallucinated agreement after about six turns).+Sometimes the two agents are talking to each other, with the human watching. A debate, a roleplay, a brainstorm. This is the cleanest pattern in terms of code (no human input gate; turns alternate on `voice:speech-end`) and the hardest pattern in terms of LLM behavior (without grounding in real user input, both agents drift into hallucinated agreement after about six turns).Concrete loop:@@ -479,10 +479,10 @@ async function autoplay(topic, turns = 6) {}function waitForSpeakEnd(el) {- return new Promise((res) => el.addEventListener('speak-end', () => res(), { once: true }));+ return new Promise((res) => el.addEventListener('voice:speech-end', () => res(), { once: true }));}function waitForChatMessage(el) {- return new Promise((res) => el.addEventListener('chat-message', (e) => {+ return new Promise((res) => el.addEventListener('brain:message', (e) => {if (e.detail?.role === 'assistant') res();}, { once: true }));}diff --git a/docs/tutorials/paid-x402-endpoint.md b/docs/tutorials/paid-x402-endpoint.mdindex 81eea684a..457e09e28 100644--- a/docs/tutorials/paid-x402-endpoint.md+++ b/docs/tutorials/paid-x402-endpoint.md@@ -28,7 +28,7 @@ This is one of the most consequential things you can build in 2026: an API thatx402 is HTTP 402 (the long-reserved "Payment Required" status) turned into a working protocol. The shape:-1. **Client requests a resource without payment.** `GET https://example.com/api/route`+1. **Client requests a resource without payment.** `GET https://three.ws/api/x402/model-check`2. **Server responds 402** with a JSON body listing what payment it will accept — scheme, network, asset, amount, recipient address, timeout. The body is also base64-encoded into a response header `payment-required` so machines that only read headers can find it.3. **Client signs a payment payload** matching one of the accepted methods (typically a USDC EIP-3009 `transferWithAuthorization` signature for Base) and retries the request with `X-PAYMENT: <base64 of signed payload>`.4. **Server verifies the payment** by calling a facilitator's `/verify` endpoint. The facilitator checks the signature and asserts (off-chain) that the buyer's wallet has the funds.diff --git a/docs/tutorials/skill-with-database-auth.md b/docs/tutorials/skill-with-database-auth.mdnew file mode 100644index 000000000..ec29956fc--- /dev/null+++ b/docs/tutorials/skill-with-database-auth.md@@ -0,0 +1,731 @@+# Custom Skill with Database and Auth++By the end of this tutorial you have a production-grade skill that reads from a real Postgres database, authenticates the caller, rate-limits both the agent and the end-user, and audits every lookup. The example we'll build is a CRM-enrichment skill: the agent gets handed a customer email by the visitor and returns the matching CRM record — but only if the agent's operator is allowed to access that record, the visitor isn't drilling through your customer list, and the lookup is logged for compliance.++This is the path from the "fetch a weather API" toy in [custom-skill](/tutorials/custom-skill) to something a real company can ship. The mechanics are mostly the same — the difference is everything around the call: auth, audit, rate limits, data shape, denial flows.++**What you'll build:**++- A Postgres-backed CRM lookup table with a real schema and indexes+- A skill manifest with a strict input schema and a clear behavioral contract+- A Vercel function that accepts a customer email, looks up the CRM row, and returns enriched data+- Per-skill HMAC signing so only the agent runtime can call your endpoint+- Rate-limiting keyed by agent ID and by end-user identifier+- An audit log row per lookup with the agent, the actor, the lookup target, and the result code+- Structured data the LLM can recite naturally+- Denial flows that don't leak data when the customer isn't found++**Prerequisites:**++- Worked through [custom-skill](/tutorials/custom-skill) and have a working four-file skill bundle deployed to a public HTTPS URL+- Node.js 24.x, `npm`, and a Vercel account (the function lives on Vercel; the skill bundle can live anywhere)+- A Postgres database. Neon (`https://neon.tech`), Vercel Postgres, or Supabase all work. ~$0/month for the free tiers and ~$20/month once you have real traffic+- Upstash Redis for rate-limiting (`https://upstash.com`). Free tier handles millions of requests/day+- One real customer email you control, to seed test data with+- An understanding that **you are now building a system that holds customer data**. Read your jurisdiction's data-protection rules. Many of the decisions in this tutorial are downstream of GDPR/CCPA-style obligations++---++## Step 1 — The data shape++We're building a CRM lookup. A CRM row in a typical SaaS company has the same broad shape regardless of vendor — name, email, company, plan, account manager, lifecycle stage, last activity. The agent's value is in **stitching that data into conversation**: when a visitor types "is John Smith from Acme on our enterprise plan yet?", the agent should be able to answer with specifics from your actual CRM.++Schema:++```sql+-- migrations/001_crm.sql+CREATE TABLE IF NOT EXISTS crm_customers (+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),+ email CITEXT NOT NULL,+ full_name TEXT NOT NULL,+ company TEXT,+ plan TEXT CHECK (plan IN ('free', 'pro', 'team', 'enterprise')),+ account_manager TEXT,+ lifecycle_stage TEXT CHECK (lifecycle_stage IN ('lead', 'trial', 'customer', 'churned')),+ mrr_usd_cents INTEGER DEFAULT 0,+ signed_up_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),+ last_active_at TIMESTAMPTZ,+ notes TEXT,+ created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),+ updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()+);++CREATE UNIQUE INDEX crm_customers_email_idx ON crm_customers (email);+CREATE INDEX crm_customers_company_idx ON crm_customers (company);++-- Access policy table: which agent operators are allowed to query which records?+-- We default to "operator can access records they own" — the operator wallet+-- is the rowner.+CREATE TABLE IF NOT EXISTS crm_access (+ customer_id UUID NOT NULL REFERENCES crm_customers(id) ON DELETE CASCADE,+ operator_id TEXT NOT NULL,+ granted_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),+ PRIMARY KEY (customer_id, operator_id)+);++-- Audit log — every lookup, success or denial.+CREATE TABLE IF NOT EXISTS crm_audit_log (+ id BIGSERIAL PRIMARY KEY,+ ts TIMESTAMPTZ NOT NULL DEFAULT NOW(),+ agent_id TEXT NOT NULL,+ operator_id TEXT,+ end_user_id TEXT, -- visitor identifier if available+ ip INET,+ email_query CITEXT NOT NULL,+ result TEXT NOT NULL CHECK (result IN ('found', 'not_found', 'denied', 'rate_limited', 'invalid')),+ duration_ms INTEGER+);++CREATE INDEX crm_audit_log_ts_idx ON crm_audit_log (ts DESC);+CREATE INDEX crm_audit_log_agent_idx ON crm_audit_log (agent_id, ts DESC);+```++Two things worth pointing out:++- **`CITEXT` for email.** Case-insensitive collation. Emails are case-insensitive by RFC; treating them as case-sensitive opens you up to duplicate rows and missed lookups.+- **`crm_access` is the authorization layer.** The operator who owns the row (or who's been granted access to it) can look it up. Anyone else can't. This separation lets you grant access to multiple operators per customer without duplicating the row.++Apply the schema:++```bash+psql "$DATABASE_URL" -f migrations/001_crm.sql+```++Seed a test row:++```sql+INSERT INTO crm_customers (email, full_name, company, plan, account_manager, lifecycle_stage, mrr_usd_cents, last_active_at, notes)+VALUES (+ '[email protected]',+ 'Test Customer',+ 'Acme Inc.',+ 'team',+ 'Jordan Reyes',+ 'customer',+ 79900,+ NOW() - INTERVAL '2 days',+ 'Migrated from Free in March 2026. Renewal in October.'+);++INSERT INTO crm_access (customer_id, operator_id)+SELECT id, '0xYourWalletOperatorId' FROM crm_customers WHERE email = '[email protected]';+```++Replace `0xYourWalletOperatorId` with the wallet address that owns your agent.++---++## Step 2 — The skill bundle++Same four-file shape as [custom-skill](/tutorials/custom-skill). The interesting bits are the input schema and the SKILL.md behavioral contract.++`manifest.json`:++```json+{+ "spec": "skill/0.1",+ "name": "crm-lookup",+ "version": "1.0.0",+ "description": "Look up a customer in our CRM by email. Operator-scoped, rate-limited, audited.",+ "author": "0xYourWalletOperatorId",+ "license": "Proprietary",+ "tags": ["crm", "sales", "internal"],+ "requires": { "rig": ["any"], "runtime": ">=0.1.0" },+ "provides": { "tools": ["lookup_customer"], "triggers": ["customer-lookup"] },+ "trust_policy": "owned-only"+}+```++The `trust_policy: "owned-only"` is important: this skill must only run inside an agent whose owner matches the `author` field. Otherwise a third party could load your skill bundle into their own agent and try to query your CRM. The skill runtime enforces this at load time (see `api/_lib/skill-access.js` in the platform for the enforcement code).++`SKILL.md`:++```markdown+---+name: crm-lookup+description: Look up a customer in our CRM by email.+triggers:+ - customer-lookup+ - account-info+cost: medium+private: true+---++# CRM Lookup Skill++You have access to the company CRM. Use `lookup_customer` when the visitor mentions a specific person or company and wants to know about their account, plan, or history.++When you call `lookup_customer`:++- Pass the customer's email if the visitor provided one.+- The tool returns either a structured record (when found and authorized) or a denial reason.+- If the record is found, speak naturally: name, company, plan, account manager. Do not recite the raw JSON.+- If the record is not found, say "I don't have a record for that email" — do not speculate, do not invent details.+- If the lookup is denied (operator-not-authorized, rate-limited, invalid query), say "I'm not able to look that up right now" without elaborating why. Don't leak the reason.+- Never volunteer CRM data the visitor didn't ask about. If they ask "what's John's plan?", answer that — don't also recite MRR, account manager, signup date.++Privacy rule: this is internal customer data. Anyone the visitor doesn't have a clear reason to know about, refuse to look up. If the visitor asks for "all customers on the enterprise plan" or "everyone Jordan manages," refuse with "I can only look up individual customers, one at a time."+```++The `private: true` frontmatter flag signals the runtime that this skill should not be advertised in the skill marketplace and should not show up in any public "what can this agent do" discovery surface.++The behavioral contract is doing a lot of work. The data privacy rules in plain language are stronger than any technical control — because the model is the surface where it gets recited, and the model will leak whatever you ask it to.++`tools.json`:++```json+{+ "tools": [+ {+ "name": "lookup_customer",+ "description": "Look up a single customer in the CRM by email address. Returns plan, company, account manager, and lifecycle stage if found and authorized. Use when the visitor asks about a specific customer's account.",+ "input_schema": {+ "type": "object",+ "properties": {+ "email": {+ "type": "string",+ "format": "email",+ "description": "Email address of the customer to look up. Must be a single email, exactly as the visitor provided it."+ }+ },+ "required": ["email"]+ }+ }+ ]+}+```++One required field, strict format. The LLM should not invent emails it wasn't given.++`handlers.js`:++```js+const ENDPOINT = 'https://crm-lookup.<your-domain>/api/lookup';++export async function lookup_customer({ email }, ctx) {+ const safe = String(email || '').trim();+ if (!safe || safe.length > 254) {+ return { ok: false, reason: 'invalid', message: 'email is required and must be valid' };+ }++ // ctx.signedRequest produces a Bearer-style HMAC header proving the runtime+ // (not arbitrary user code) is making the call. The agent's operator wallet+ // and skill identity are signed into the token. The endpoint verifies.+ const res = await ctx.fetch(ENDPOINT, {+ method: 'POST',+ headers: {+ 'content-type': 'application/json',+ authorization: await ctx.signedRequest({+ skill: 'crm-lookup',+ action: 'lookup',+ target: safe,+ }),+ },+ body: JSON.stringify({ email: safe }),+ });++ if (res.status === 429) return { ok: false, reason: 'rate_limited' };+ if (res.status === 403) return { ok: false, reason: 'denied' };+ if (res.status === 404) return { ok: false, reason: 'not_found' };+ if (!res.ok) return { ok: false, reason: 'error', message: `service ${res.status}` };++ const data = await res.json();+ return { ok: true, customer: data };+}+```++`ctx.signedRequest` is the skill runtime's API for getting a server-verifiable bearer token tied to (agent ID, skill name, operator wallet, timestamp). It returns a string like `Bearer <base64payload>.<signature>`. The endpoint (next section) verifies the signature with an HMAC key that the skill bundle and the endpoint both share via env vars.++If your runtime version doesn't expose `ctx.signedRequest`, the alternative is to embed a per-skill API key in env via the agent operator's settings UI and pass it as the `Authorization` header. The HMAC route is safer because the secret never reaches the agent's manifest URL.++---++## Step 3 — The Vercel function++Create `api/lookup.js` in a new Vercel project. This is the endpoint the skill calls.++Install deps:++```bash+npm init -y+npm pkg set type="module"+npm install pg @upstash/redis @upstash/ratelimit+```++```js+// api/lookup.js+import { Pool } from 'pg';+import { Redis } from '@upstash/redis';+import { Ratelimit } from '@upstash/ratelimit';+import crypto from 'node:crypto';++const HMAC_SECRET = process.env.SKILL_HMAC_SECRET;+const SKILL_NAME = 'crm-lookup';+const DATABASE_URL = process.env.DATABASE_URL;++if (!HMAC_SECRET) throw new Error('SKILL_HMAC_SECRET required');+if (!DATABASE_URL) throw new Error('DATABASE_URL required');++const pool = new Pool({ connectionString: DATABASE_URL, max: 5 });+const redis = Redis.fromEnv();++// 60 lookups per minute per agent; 10 per minute per end-user.+const rlAgent = new Ratelimit({+ redis,+ limiter: Ratelimit.slidingWindow(60, '60 s'),+ prefix: 'rl:crm:agent',+});+const rlUser = new Ratelimit({+ redis,+ limiter: Ratelimit.slidingWindow(10, '60 s'),+ prefix: 'rl:crm:user',+});++function unauthorized(res, msg) {+ res.status(401).json({ error: msg });+}++function denied(res) {+ // Generic 403 — don't leak which condition failed.+ res.status(403).json({ error: 'denied' });+}++function verifyToken(authHeader) {+ if (!authHeader?.startsWith('Bearer ')) return null;+ const token = authHeader.slice(7);+ const [payloadB64, sig] = token.split('.');+ if (!payloadB64 || !sig) return null;+ const expected = crypto+ .createHmac('sha256', HMAC_SECRET)+ .update(payloadB64)+ .digest('base64url');+ // Timing-safe compare.+ try {+ if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) return null;+ } catch {+ return null;+ }+ let payload;+ try {+ payload = JSON.parse(Buffer.from(payloadB64, 'base64url').toString('utf8'));+ } catch {+ return null;+ }+ // Token must be fresh (5 minutes).+ if (Math.abs(Date.now() - payload.iat) > 5 * 60 * 1000) return null;+ if (payload.skill !== SKILL_NAME) return null;+ if (!payload.agent_id || !payload.operator_id) return null;+ return payload;+}++async function audit(row) {+ try {+ await pool.query(+ `INSERT INTO crm_audit_log (agent_id, operator_id, end_user_id, ip, email_query, result, duration_ms)+ VALUES ($1, $2, $3, $4, $5, $6, $7)`,+ [+ row.agent_id,+ row.operator_id,+ row.end_user_id,+ row.ip,+ row.email_query,+ row.result,+ row.duration_ms,+ ],+ );+ } catch (err) {+ // Never let an audit failure break the user-facing request — but log it loudly.+ console.error('audit write failed', err);+ }+}++export default async function handler(req, res) {+ const started = Date.now();+ res.setHeader('access-control-allow-origin', '*');+ res.setHeader('access-control-allow-headers', 'authorization,content-type');+ if (req.method === 'OPTIONS') return res.status(204).end();+ if (req.method !== 'POST') {+ res.setHeader('allow', 'POST');+ return res.status(405).json({ error: 'method not allowed' });+ }++ const token = verifyToken(req.headers.authorization);+ if (!token) return unauthorized(res, 'invalid token');++ const ip = (req.headers['x-forwarded-for'] || '').split(',')[0].trim() || null;+ const endUserId = req.headers['x-end-user-id'] || null;+ const agentId = token.agent_id;+ const operatorId = token.operator_id;++ const body = req.body || {};+ const email = String(body.email || '').trim().toLowerCase();++ if (!email || email.length > 254 || !email.includes('@')) {+ await audit({+ agent_id: agentId, operator_id: operatorId, end_user_id: endUserId,+ ip, email_query: email, result: 'invalid', duration_ms: Date.now() - started,+ });+ return res.status(400).json({ error: 'invalid email' });+ }++ // Rate-limit per agent first (cheap, most-likely-to-trigger).+ const agentRl = await rlAgent.limit(agentId);+ if (!agentRl.success) {+ await audit({+ agent_id: agentId, operator_id: operatorId, end_user_id: endUserId,+ ip, email_query: email, result: 'rate_limited', duration_ms: Date.now() - started,+ });+ res.setHeader('retry-after', Math.ceil((agentRl.reset - Date.now()) / 1000));+ return res.status(429).json({ error: 'rate limited' });+ }+ if (endUserId) {+ const userRl = await rlUser.limit(endUserId);+ if (!userRl.success) {+ await audit({+ agent_id: agentId, operator_id: operatorId, end_user_id: endUserId,+ ip, email_query: email, result: 'rate_limited', duration_ms: Date.now() - started,+ });+ res.setHeader('retry-after', Math.ceil((userRl.reset - Date.now()) / 1000));+ return res.status(429).json({ error: 'rate limited' });+ }+ }++ // The actual query. Operator scoping happens via a JOIN against crm_access —+ // we only return the row if (a) it exists, and (b) the caller's operator is+ // authorized for it. Both "not found" and "not authorized" produce 404 on the+ // wire so unauthorized callers can't probe to see which emails exist.+ const sql = `+ SELECT c.id, c.email, c.full_name, c.company, c.plan, c.account_manager,+ c.lifecycle_stage, c.mrr_usd_cents, c.signed_up_at, c.last_active_at, c.notes+ FROM crm_customers c+ JOIN crm_access a ON a.customer_id = c.id+ WHERE c.email = $1 AND a.operator_id = $2+ LIMIT 1;+ `;+ const r = await pool.query(sql, [email, operatorId]);+ if (r.rows.length === 0) {+ await audit({+ agent_id: agentId, operator_id: operatorId, end_user_id: endUserId,+ ip, email_query: email, result: 'not_found', duration_ms: Date.now() - started,+ });+ return res.status(404).json({ error: 'not_found' });+ }++ const row = r.rows[0];+ await audit({+ agent_id: agentId, operator_id: operatorId, end_user_id: endUserId,+ ip, email_query: email, result: 'found', duration_ms: Date.now() - started,+ });++ // Project to a clean, LLM-friendly shape. Note we round MRR to dollars and+ // drop the internal `id` — the LLM doesn't need primary keys.+ return res.status(200).json({+ email: row.email,+ name: row.full_name,+ company: row.company,+ plan: row.plan,+ account_manager: row.account_manager,+ lifecycle_stage: row.lifecycle_stage,+ mrr_usd: Math.round(row.mrr_usd_cents / 100),+ signed_up: row.signed_up_at?.toISOString().slice(0, 10),+ last_active: row.last_active_at?.toISOString().slice(0, 10),+ notes: row.notes,+ });+}+```++Deploy:++```bash+vercel link+vercel env add DATABASE_URL production+vercel env add SKILL_HMAC_SECRET production # generate: openssl rand -hex 32+vercel env add UPSTASH_REDIS_REST_URL production+vercel env add UPSTASH_REDIS_REST_TOKEN production+vercel --prod+```++Note `vercel.json` in this project should set `functions.api/**/*.js.maxDuration` to at least 10 — the audit insert plus the SELECT plus the rate-limit round trip together can take a second or two on cold start.++---++## Step 4 — The HMAC dance, in detail++Step 3's `verifyToken` is the security boundary. Three things it enforces:++**Signature integrity.** The token is `<base64url(JSON payload)>.<HMAC-SHA256 of that base64>`. The HMAC key is shared between the agent runtime and the endpoint. Anyone without the key can't forge tokens. `crypto.timingSafeEqual` defends against timing-side-channel attacks on the comparison.++**Freshness.** `Math.abs(Date.now() - payload.iat) > 5 * 60 * 1000` enforces a 5-minute freshness window. An attacker who steals one token can only replay it for 5 minutes. The window is short enough to limit replay damage, long enough to tolerate clock skew on either side.++**Identity binding.** `payload.skill === SKILL_NAME` rejects tokens minted for a different skill. `payload.agent_id` and `payload.operator_id` are present and used downstream for scoping. The agent's runtime fills these from the runtime context — the skill code itself can't lie about which agent it's running inside.++The shared HMAC secret has to live in three places: the skill runtime (where `ctx.signedRequest` mints tokens), the agent's operator settings (where the operator pastes the secret so their runtime can sign for their skill), and your endpoint env vars. Rotate it on a schedule. Document the rotation procedure now, before you forget.++---++## Step 5 — Test the happy path++In a terminal, mint a token manually and call the endpoint:++```bash+SECRET='<your-hmac-secret>'+PAYLOAD=$(printf '%s' '{"skill":"crm-lookup","agent_id":"agent-test","operator_id":"0xYourWalletOperatorId","iat":'"$(date +%s)000"'}' | base64 -w0 | tr '+/' '-_' | tr -d '=')+SIG=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" -binary | base64 -w0 | tr '+/' '-_' | tr -d '=')+curl -X POST https://crm-lookup.<your-domain>/api/lookup \+ -H "authorization: Bearer $PAYLOAD.$SIG" \+ -H 'content-type: application/json' \+ -d '{"email":"[email protected]"}'+```++Expected output:++```json+{"email":"[email protected]","name":"Test Customer","company":"Acme Inc.","plan":"team","account_manager":"Jordan Reyes","lifecycle_stage":"customer","mrr_usd":799,"signed_up":"2026-05-12","last_active":"2026-05-12","notes":"Migrated from Free in March 2026. Renewal in October."}+```++Now load the skill into your agent (the skill bundle from Step 2, hosted at any HTTPS URL — see [custom-skill](/tutorials/custom-skill) for hosting options). Ask: "what plan is [email protected] on?" The agent should call the tool and respond with something like:++> "[email protected] — Test Customer at Acme — is on the team plan, managed by Jordan Reyes."++Confirm the audit log was written:++```sql+SELECT ts, agent_id, email_query, result, duration_ms+FROM crm_audit_log+ORDER BY ts DESC LIMIT 5;+```++You should see a `found` row for the lookup you just did.++---++## Step 6 — Test the denial paths++A skill that handles real customer data lives or dies by its denial paths. Walk through each:++**Not found.** Ask the agent about an email that doesn't exist. Expected: the agent says "I don't have a record for that email" without speculating. The audit log shows a `not_found` row.++**Not authorized.** Insert a row but don't grant `crm_access` to your operator. Ask the agent to look it up. The endpoint returns 404 (intentionally indistinguishable from "not found" on the wire — see Step 3's comment on probing). The audit log shows a `not_found` row, because from the operator's perspective the row may as well not exist.++**Invalid input.** Ask the agent "look up `xxx`" — no `@` in the input. The skill's handler short-circuits with `reason: 'invalid'`. The audit log shows an `invalid` row.++**Rate limited.** Trigger the limit. The easiest way is to script 80 lookups in 10 seconds against a single agent. The 61st onwards return 429. The audit log fills with `rate_limited` rows. The skill's handler returns `reason: 'rate_limited'` to the LLM, and the SKILL.md instructions kick in: the agent says "I'm not able to look that up right now."++**Tampered token.** Manually flip one bit in the signature, replay. The endpoint returns 401. The audit log does **not** write a row (the request was rejected before reaching the audit insert). This is intentional — the audit log is for authorized usage, not for failed auth attempts. Failed auth belongs in a separate WAF/logging layer.++Walk these four paths every time you change anything in the auth or rate-limit code. It's the only way to catch regressions before they ship.++---++## Step 7 — Build admin tooling++You now have audit logs. Build the admin surface that lets you read them:++```sql+-- Lookups per agent per day, last 7 days+SELECT date_trunc('day', ts)::date AS day,+ agent_id,+ count(*) FILTER (WHERE result = 'found') AS found,+ count(*) FILTER (WHERE result = 'not_found') AS not_found,+ count(*) FILTER (WHERE result = 'denied') AS denied,+ count(*) FILTER (WHERE result = 'rate_limited') AS rate_limited+FROM crm_audit_log+WHERE ts >= NOW() - INTERVAL '7 days'+GROUP BY day, agent_id+ORDER BY day DESC, agent_id;+```++```sql+-- Most-queried customers (potential phishing reconnaissance)+SELECT email_query, count(*) AS hits+FROM crm_audit_log+WHERE ts >= NOW() - INTERVAL '24 hours'+GROUP BY email_query+ORDER BY hits DESC+LIMIT 20;+```++```sql+-- Slowest lookups (find your bad indexes)+SELECT email_query, duration_ms+FROM crm_audit_log+WHERE result = 'found'+ORDER BY duration_ms DESC+LIMIT 20;+```++Run these as scheduled queries. The first one is your usage dashboard. The second is a security alert candidate — if one email shows up 200 times in a day across multiple visitors, you might be the entry point for a recon attack. The third is your performance dashboard.++For a richer admin UI, point Metabase or Grafana at the Postgres instance with a read-only role:++```sql+CREATE ROLE crm_admin_readonly LOGIN PASSWORD '<strong>';+GRANT SELECT ON crm_audit_log TO crm_admin_readonly;+GRANT SELECT ON crm_customers TO crm_admin_readonly;+```++---++## Step 8 — Schema migrations++Production CRM schemas change. The migration runner the platform uses is straightforward: a `migrations/` directory of timestamped SQL files, plus a tiny script that tracks which have been applied. Set this up now, before you have data you'd hate to lose.++```sql+-- migrations/000_meta.sql+CREATE TABLE IF NOT EXISTS schema_migrations (+ filename TEXT PRIMARY KEY,+ applied_at TIMESTAMPTZ NOT NULL DEFAULT NOW()+);+```++```js+// scripts/migrate.js+import { Pool } from 'pg';+import fs from 'node:fs/promises';+import path from 'node:path';++const pool = new Pool({ connectionString: process.env.DATABASE_URL });+const dir = path.resolve('./migrations');+const files = (await fs.readdir(dir)).filter((f) => f.endsWith('.sql')).sort();++await pool.query(`CREATE TABLE IF NOT EXISTS schema_migrations (+ filename TEXT PRIMARY KEY,+ applied_at TIMESTAMPTZ NOT NULL DEFAULT NOW()+)`);++const applied = new Set(+ (await pool.query('SELECT filename FROM schema_migrations')).rows.map((r) => r.filename),+);++for (const f of files) {+ if (applied.has(f)) continue;+ console.log(`applying ${f}`);+ const sql = await fs.readFile(path.join(dir, f), 'utf8');+ const client = await pool.connect();+ try {+ await client.query('BEGIN');+ await client.query(sql);+ await client.query('INSERT INTO schema_migrations (filename) VALUES ($1)', [f]);+ await client.query('COMMIT');+ } catch (err) {+ await client.query('ROLLBACK');+ console.error(`failed on ${f}:`, err.message);+ process.exit(1);+ } finally {+ client.release();+ }+}++console.log('migrations up to date');+await pool.end();+```++Run with `DATABASE_URL=... node scripts/migrate.js`. Add it to your deploy hook:++```json+{+ "scripts": {+ "build": "node scripts/migrate.js"+ }+}+```++Forward-only migrations are simpler than rollbacks and the right default. If you need to rollback, write a forward migration that reverses the prior one.++---++## Step 9 — Data retention and the audit log++Audit logs grow without bound. A skill at 1000 lookups/day produces 365k audit rows a year. The table stays small enough for SELECT performance, but compliance frameworks (GDPR, SOC2) often require explicit retention policies.++A reasonable default: 13 months. Drop anything older nightly:++```sql+DELETE FROM crm_audit_log WHERE ts < NOW() - INTERVAL '13 months';+```++Run via a cron job (Vercel cron, GitHub Actions on a schedule, Postgres pg_cron — pick one). Document the policy in your privacy notice.++For the `crm_customers` table itself, the rules are stricter. Customer-data retention is jurisdictional. The minimum control: implement a deletion endpoint that, given a customer email and operator authorization, cascades the row out of all tables. The `ON DELETE CASCADE` on `crm_access` already handles its half. Add an explicit purge for the audit log too if your privacy commitment requires it:++```sql+DELETE FROM crm_audit_log WHERE email_query = $1 AND ts >= NOW() - INTERVAL '13 months';+```++Don't delete audit rows just because the row they refer to was deleted — the audit log is the historical record. But honor "right to be forgotten" requests by hashing the email in old audit rows rather than dropping them entirely, so aggregate stats still work but the PII is gone.++---++## Step 10 — Performance++The query in Step 3 is one SELECT with one JOIN and two indexed lookups. On a small CRM (<100k customers), it returns in single-digit milliseconds. On a larger one, watch the EXPLAIN plan as access patterns evolve:++```sql+EXPLAIN ANALYZE+SELECT c.id FROM crm_customers c+JOIN crm_access a ON a.customer_id = c.id+WHERE c.email = '[email protected]' AND a.operator_id = '0xYourWalletOperatorId';+```++The plan should show two index scans and a nested loop. If you see a sequential scan, an index is missing (likely on `crm_access(operator_id)`):++```sql+CREATE INDEX IF NOT EXISTS crm_access_operator_idx ON crm_access (operator_id);+```++The audit log insert is the second-most-frequent operation. It's not indexed for fast inserts (the BIGSERIAL primary key is enough), but the `ts DESC` and `(agent_id, ts DESC)` indexes from Step 1 are required for reads. Without them, dashboard queries get slow fast.++Connection pooling: `new Pool({ max: 5 })` is right for serverless. Going higher exhausts connection slots on shared Postgres tiers (Neon free tier is 100 connections total). Use a pgBouncer-style external pooler (Neon and Supabase both provide one out of the box at a separate hostname) for hot endpoints.++---++## Step 11 — Operating in the wild++Once this is in production, the operational reality:++**Customer signs up at 2am.** The CRM row is created in your main backend. You need a `crm_access` insert to grant the operator (whoever owns the account) access to that customer. If you forget to insert the access row, the lookup fails silently for the operator. Build the access grant into the same transaction as the customer creation.++**Agent operator leaves.** Revoke their access by deleting their `crm_access` rows. Their agent will continue to run, but lookups will return 404. Their audit log entries are preserved — you can prove what they did and when they stopped having access.++**LLM tries to recite the entire CRM.** The behavioral contract in SKILL.md says "look up one at a time, refuse bulk requests." The runtime can't enforce this — the LLM might still try. Add a defense in depth: at the endpoint, reject any payload other than a single `email` string. If the model tries to send `{"emails": [...]}`, you 400. Belt and suspenders.++**Visitor asks "do you have a Sarah?".** The LLM has no email — what does it do? Without an email it can't call the tool (the input schema requires `email`). It should say "I need an email to look up an account." That's the right answer. Don't add a "search by name" tool unless you accept the privacy implications of letting visitors brute-force your customer list.++**Endpoint goes down.** The skill returns `reason: 'error'`. The agent says "I can't reach the CRM right now." This is the correct degradation — better than fabricating an answer. Make sure your monitoring covers the endpoint with health checks; the agent's failure to look up customers should page someone.++---++## Step 12 — Pre-production checklist++Before this skill faces a real visitor:++- All migrations applied. `SELECT * FROM schema_migrations` matches the `migrations/` directory.+- Rate limits dialed in to numbers you can defend. Default 60/min per agent and 10/min per end-user is sensible; adjust by use case.+- HMAC secret is high-entropy (`openssl rand -hex 32`), set in Vercel, set in the agent's operator settings, never committed.+- Audit table indexes verified (`\d+ crm_audit_log`).+- Audit log retention job scheduled.+- Right-to-be-forgotten flow tested end-to-end.+- The SKILL.md behavioral contract has been read by someone who isn't you, and they agree it's clear about what to do in denial cases.+- A test agent has been put through all five denial paths in Step 6 and behaved correctly.+- A monitoring alert fires on a 5xx rate above 1% over 10 minutes from `/api/lookup`.+- A second alert fires on `count(*) FILTER (WHERE result = 'denied')` going non-zero — this is a sign of either misconfigured access grants or someone probing.+- The `private: true` flag on the skill is respected by your runtime — the skill should not appear in any public listing.+- The fact that this skill exists is documented in your privacy notice, including the data it sees and the retention period.++---++## What you learned++- A Postgres schema for a real CRM with operator-scoped access and a separate audit log+- The skill bundle shape for production: strict input schema, behavioral privacy contract in SKILL.md, signed-request handler+- An HMAC-signed bearer-token pattern that authenticates the agent runtime (not arbitrary skill code)+- Rate-limiting at two levels (per agent, per end-user) with Upstash Redis+- Denial flows that don't leak information about whether a record exists+- Operational concerns: schema migrations, audit retention, performance, right-to-be-forgotten++## Next steps++- Combine this skill with a paid x402 endpoint so external agents can pay to query (a portion of) your CRM — [paid-x402-endpoint](/tutorials/paid-x402-endpoint)+- Expose the agent that owns this skill as an MCP server so internal tools can use it — [mcp-server-for-your-agent](/tutorials/mcp-server-for-your-agent)+- Self-host the whole stack so the data residency story is fully your own — [self-host-agent-backend](/tutorials/self-host-agent-backend)+- Warm up with the simpler version if you skipped ahead — [custom-skill](/tutorials/custom-skill)diff --git a/public/nav.css b/public/nav.cssindex 5bc543681..3893e05ea 100644--- a/public/nav.css+++ b/public/nav.css@@ -114,6 +114,37 @@align-items: center;}+/* Subdued pill used on the Labs trigger — signals experimental without+ competing with the vivid "NEW" badge. */+.home-nav .nav-pill {+ display: inline-block;+ padding: 1px 6px;+ margin-left: 6px;+ background: rgba(255, 255, 255, 0.08);+ color: rgba(255, 255, 255, 0.65);+ border: 1px solid rgba(255, 255, 255, 0.14);+ border-radius: 4px;+ font-size: 9px;+ font-weight: 600;+ letter-spacing: 0.08em;+ vertical-align: 1px;+}++.home-nav .nav-menu-labs {+ min-width: 280px;+}++.home-nav .nav-menu-note {+ padding: 8px 12px 10px;+ margin-bottom: 4px;+ border-bottom: 1px solid rgba(255, 255, 255, 0.06);+ color: rgba(255, 255, 255, 0.5);+ font-size: 0.72rem;+ line-height: 1.4;+ letter-spacing: 0.01em;+ list-style: none;+}+/* ── Hamburger button (desktop: hidden) ── */.home-nav .nav-burger {diff --git a/public/nav.html b/public/nav.htmlindex de018d859..70c84519d 100644--- a/public/nav.html+++ b/public/nav.html@@ -105,30 +105,6 @@><span class="nav-mi-sub">Watches · scanner · quotes</span></a></li>- <li role="none">- <a href="/pump-visualizer" role="menuitem"- ><span class="nav-mi-title">Pump Visualizer</span- ><span class="nav-mi-sub">3D view of trending tokens</span></a- >- </li>- <li role="none">- <a href="/vanity-wallet" role="menuitem"- ><span class="nav-mi-title">Vanity wallet</span- ><span class="nav-mi-sub">Grind a Solana address</span></a- >- </li>- <li role="none">- <a href="/eth-vanity" role="menuitem"- ><span class="nav-mi-title">ETH vanity (CREATE2)</span- ><span class="nav-mi-sub">Grind a smart-contract address</span></a- >- </li>- <li role="none">- <a href="/strategy-lab" role="menuitem"- ><span class="nav-mi-title">Strategy Lab</span- ><span class="nav-mi-sub">DCA + subscriptions</span></a- >- </li><li role="none"><a href="/docs#solana" role="menuitem"><span class="nav-mi-title">Solana SDK</span@@ -160,18 +136,6 @@><span class="nav-mi-sub">Tune mode, size, position</span></a></li>- <li role="none">- <a href="/artifact" role="menuitem"- ><span class="nav-mi-title">Artifact viewer</span- ><span class="nav-mi-sub">Claude artifact bundle</span></a- >- </li>- <li role="none">- <a href="/avatar-artifact" role="menuitem"- ><span class="nav-mi-title">Avatar artifact</span- ><span class="nav-mi-sub">Standalone Three.js viewer</span></a- >- </li><li role="none"><a href="/docs#embedding" role="menuitem"><span class="nav-mi-title">Embed docs</span@@ -215,16 +179,69 @@><span class="nav-mi-sub">SDKs + API reference</span></a></li>+ </ul>+ </li>+ <li class="nav-item nav-has-menu" role="none">+ <button+ type="button"+ class="nav-trigger"+ aria-haspopup="true"+ aria-expanded="false"+ role="menuitem"+ >+ Labs<span class="nav-pill" aria-hidden="true">BETA</span+ ><span class="nav-caret" aria-hidden="true">▾</span>+ </button>+ <ul class="nav-menu nav-menu-labs" role="menu" aria-label="Labs">+ <li class="nav-menu-note" role="none" aria-hidden="true">+ Experimental features — actively iterating. Expect rough edges.+ </li><li role="none"><a href="/pretext-demo" role="menuitem"- ><span class="nav-mi-title">Demo</span+ ><span class="nav-mi-title">Pretext demo</span><span class="nav-mi-sub">Give your AI a body</span></a></li>+ <li role="none">+ <a href="/strategy-lab" role="menuitem"+ ><span class="nav-mi-title">Strategy Lab</span+ ><span class="nav-mi-sub">DCA + subscriptions</span></a+ >+ </li>+ <li role="none">+ <a href="/pump-visualizer" role="menuitem"+ ><span class="nav-mi-title">Pump Visualizer</span+ ><span class="nav-mi-sub">3D view of trending tokens</span></a+ >+ </li>+ <li role="none">+ <a href="/artifact" role="menuitem"+ ><span class="nav-mi-title">Artifact viewer</span+ ><span class="nav-mi-sub">Claude artifact bundle</span></a+ >+ </li>+ <li role="none">+ <a href="/avatar-artifact" role="menuitem"+ ><span class="nav-mi-title">Avatar artifact</span+ ><span class="nav-mi-sub">Standalone Three.js viewer</span></a+ >+ </li>+ <li role="none">+ <a href="/eth-vanity" role="menuitem"+ ><span class="nav-mi-title">ETH vanity (CREATE2)</span+ ><span class="nav-mi-sub">Grind a smart-contract address</span></a+ >+ </li>+ <li role="none">+ <a href="/vanity-wallet" role="menuitem"+ ><span class="nav-mi-title">Vanity wallet</span+ ><span class="nav-mi-sub">Grind a Solana address</span></a+ >+ </li><li role="none"><a href="/launch-week" role="menuitem"- ><span class="nav-mi-title">Launch Week</span- ><span class="nav-mi-sub">Recap · stats · highlights</span></a+ ><span class="nav-mi-title">Launch Week recap</span+ ><span class="nav-mi-sub">Stats · highlights · archive</span></a></li></ul>