Skip to content

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.

36.7 KB
Raw Blame
/*
 * Tutorial manifest — single source of truth for the tutorial library.
 *
 * Loaded as a classic script by /tutorials (the 3-tier index) and
 * /tutorials/<slug> (the viewer template) — exposes window.TUTORIALS.
 *
 * Each entry maps to a long-form markdown file at /docs/tutorials/<slug>.md
 * which is fetched and rendered by the viewer.
 */
(function () {
	const TUTORIALS = [
		/* ─────────────────────────── EASY ─────────────────────────── */
		{
			slug: 'getting-started',
			tier: 'easy',
			title: 'Getting started (hosted)',
			blurb: 'A five-minute, no-code tour: create an agent, pick a body, give it a personality, share the URL.',
			builds: 'Your first hosted agent with a shareable URL',
			time: '5 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the editor', href: '/create' },
		},
		{
			slug: 'explore-docs-world',
			tier: 'easy',
			title: 'Explore the docs as a 3D world',
			blurb: 'Walk an avatar through the documentation: fourteen sections as glowing pavilions, live pages read in-world, shareable deep links, and your own GLB as the body.',
			builds: 'Fluency with the immersive docs at /docs/world',
			time: '5 min',
			previewModel: '/avatars/mannequin.glb',
			ctaPrimary: { label: 'Enter the Docs World', href: '/docs/world' },
		},
		{
			slug: 'add-a-3d-assistant',
			tier: 'easy',
			title: 'Add a 3D avatar assistant to your site',
			blurb: 'One script tag adds a floating 3D avatar with a chatbot and a speak mode to any website. Configure the avatar, background, and brand, drive it from your own code, or have an AI agent generate the embed.',
			builds: 'A branded 3D assistant widget embedded on your own page',
			time: '8 min',
			previewModel: '/avatars/selfie-girl.glb',
			ctaPrimary: { label: 'Open the builder', href: '/assistant' },
		},
		{
			slug: 'first-prompt-to-3d',
			tier: 'easy',
			title: 'Your first prompt to 3D in ChatGPT',
			blurb: 'Type one sentence into ChatGPT and get a real, textured 3D model back: spin it in the browser, download the GLB, and place it in your room through your phone camera. Free, and no three.ws account, wallet, or API key.',
			builds: 'A generated 3D model, straight out of a ChatGPT conversation',
			time: '5 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the 3D Studio', href: '/docs/chatgpt-3d-studio-gpt' },
		},
		{
			slug: 'text-to-3d',
			tier: 'easy',
			title: 'Turn a text prompt into a 3D model',
			blurb: 'Type one sentence in the Forge, watch it become real geometry, and download the GLB. Quality tiers, rating, sharing — the full loop.',
			builds: 'Your first AI-generated 3D model, downloaded as a GLB',
			time: '5 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the Forge', href: '/forge' },
		},
		{
			slug: 'image-to-3d',
			tier: 'easy',
			title: 'Turn photos into a 3D model',
			blurb: 'Photograph a real object from up to four angles, drop the shots into the Forge, and reconstruct it as a textured 3D model.',
			builds: 'A 3D model of a real object, reconstructed from your photos',
			time: '10 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open the Forge', href: '/forge' },
		},
		{
			slug: 'prompts-for-3d',
			tier: 'easy',
			title: 'Prompt recipes for 3D generation',
			blurb: 'A copy-paste cookbook: game props, furniture, characters, vehicles, food — plus the four rules that make any 3D prompt work.',
			builds: 'A personal library of prompts that reliably produce great models',
			time: '8 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the Forge', href: '/forge' },
		},
		{
			slug: 'nvidia-3d-free',
			tier: 'easy',
			title: 'Generate 3D models free, powered by NVIDIA',
			blurb: "The Forge's free text-to-3D runs Microsoft TRELLIS, with NVIDIA NIM as the hosted rung behind our own GPU workers. No key, no cost. Learn when the NVIDIA lane serves your prompt, how to pin it, and how to watch TRELLIS rebuild a mesh live.",
			builds: 'A 3D model generated free on the NVIDIA NIM lane, downloaded as a GLB',
			time: '8 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the NIM demo', href: '/forge-nim' },
		},
		{
			slug: 'embed-in-30-seconds',
			tier: 'easy',
			title: 'Embed in 30 seconds',
			blurb: 'Drop one script tag into any HTML page. Your agent loads, auto-sizes, and starts animating.',
			builds: 'A live agent on any web page with one line of HTML',
			time: '2 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open Widget Studio', href: '/studio' },
		},
		{
			slug: 'customize-appearance',
			tier: 'easy',
			title: 'Customize size, position & background',
			blurb: 'Tune every visible knob on the <agent-3d> element: layout mode, corner placement, size, background, camera framing, and the ambient clip.',
			builds: 'A pixel-perfect floating agent that matches your site',
			time: '8 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Widget Studio', href: '/studio' },
		},
		{
			slug: 'swap-avatar-in-studio',
			tier: 'easy',
			title: 'Pick & swap an avatar in Studio',
			blurb: 'Swap an agent\'s 3D body from the Outfit panel in one click, and have the change reach every embed without touching your snippet.',
			builds: 'A library of swappable avatar bodies for the same agent',
			time: '6 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open My Agents', href: '/my-agents' },
		},
		{
			slug: 'greeting-and-first-speech',
			tier: 'easy',
			title: 'Add a greeting & first speech line',
			blurb: 'Make your agent say hello the moment it loads, and have its mouth move with the words.',
			builds: 'An agent that greets every visitor by voice',
			time: '7 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open Widget Studio', href: '/studio' },
		},
		{
			slug: 'share-your-agent',
			tier: 'easy',
			title: 'Share your agent (link, QR, social preview)',
			blurb: 'Get a permanent link to your agent, generate a QR for print, and share the URL that unfurls with its real name, description, and card.',
			builds: 'A shareable agent URL with rich previews on every platform',
			time: '6 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open My Agents', href: '/my-agents' },
		},
		{
			slug: 'selfie-to-avatar',
			tier: 'easy',
			title: 'Turn a selfie into a 3D avatar',
			blurb: 'Snap or upload a photo and get a rigged 3D avatar that can walk, wave, and talk, then put it on an agent.',
			builds: 'A rigged 3D avatar of a real face, ready to animate',
			time: '8 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open the Scanner', href: '/scan' },
		},
		{
			slug: 'view-in-ar',
			tier: 'easy',
			title: 'View your 3D model in AR',
			blurb: 'See any three.ws model in augmented reality and walk around it in your kitchen, straight from the browser with no app to install. iOS Quick Look, Android Scene Viewer, and WebXR.',
			builds: 'A 3D model you can place and view in your real room',
			time: '8 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the Forge', href: '/forge' },
		},
		{
			slug: 'import-avatar-url',
			tier: 'easy',
			title: 'Import an avatar by URL',
			blurb: 'Bring any hosted glTF/GLB avatar into three.ws by link: auto-validated, auto-rigged, ready for an agent.',
			builds: 'An imported avatar live on your account from a single URL',
			time: '6 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Import an avatar', href: '/import/rpm' },
		},
		{
			slug: 'sign-with-your-avatar',
			tier: 'easy',
			title: 'Make your avatar sign (ASL)',
			blurb: 'Type a phrase and watch an avatar sign it in American Sign Language, share it as a link, export a spelled word as an animated GLB, turn on signed AI chat replies, and fingerspell back with your webcam.',
			builds: 'A signing avatar you can share as a link, embed, and sign back to',
			time: '15 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open sign language', href: '/sign-language' },
		},
		{
			slug: 'walk-companion',
			tier: 'easy',
			title: 'Add the Walk Companion to your site',
			blurb: 'Drop a 3D avatar that strolls across any web page — corner mascot or full-page playground — with one script tag, the npm SDK, or a postMessage bridge.',
			builds: 'A walking 3D avatar living on your own website',
			time: '15 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Walk', href: '/walk' },
		},
		{
			slug: 'shopify-store-guide',
			tier: 'easy',
			title: 'Add a 3D store guide to Shopify (no code)',
			blurb: 'Point and click in a live playground to build a 3D guide that walks your store and narrates it, preview it instantly, then paste it into Shopify. No code, ten minutes.',
			builds: 'A walking, narrating 3D store guide live on your Shopify store',
			time: '10 min',
			previewModel: '/avatars/realistic-female.glb',
			ctaPrimary: { label: 'Open the Tour Builder', href: '/tour-builder' },
		},
		{
			slug: 'shopify-shopping-assistant',
			tier: 'easy',
			title: 'Add a 3D AI shopping assistant to Shopify',
			blurb: 'A floating chat with a rigged 3D avatar that answers questions, recommends real products from your live catalog, and helps shoppers check out. One script tag, no app install, no product feed to maintain.',
			builds: 'A shopping assistant with a face, live on your Shopify store',
			time: '12 min',
			previewModel: '/avatars/realistic-female.glb',
			ctaPrimary: { label: 'Open the Concierge', href: '/concierge' },
		},
		{
			slug: 'sperax-tour',
			tier: 'easy',
			title: 'Load a ready-made 3D tour for a DeFi protocol (Sperax)',
			blurb: 'The Tour Builder\'s first template: an 8-stop guided tour of Sperax\'s USDs auto-yield stablecoin, ready to load, edit, and export as a one-tag snippet in minutes.',
			builds: 'A partner-ready 3D guided tour, exported as a one-tag snippet',
			time: '5 min',
			previewModel: '/avatars/realistic-female.glb',
			ctaPrimary: { label: 'Open the Tour Builder', href: '/tour-builder' },
		},

		/* ────────────────────────── MIDDLE ────────────────────────── */
		{
			slug: 'animate-your-agent',
			tier: 'middle',
			title: 'Give your agent body language',
			blurb: 'Clips, slots and hints: the three-name chain that makes an agent nod, look down while it reads, celebrate a settled payment, and dance on request. Re-point any gesture without touching skill code.',
			builds: 'An agent that gestures on its own, with a vocabulary you control',
			time: '12 min',
			previewModel: '/avatars/michelle.glb',
			ctaPrimary: { label: 'Open the gesture vocabulary', href: '/gestures' },
		},
		{
			slug: 'shopify-store-guide-advanced',
			tier: 'middle',
			title: 'Customize your Shopify 3D store guide',
			blurb: 'Hand-tune the store guide: exact section targeting, multi-page tours across your catalog, real spoken voices, your own avatar, autostart, deep links, and the JavaScript API.',
			builds: 'A fully customized, multi-page 3D store tour with voice and custom avatar',
			time: '30 min',
			previewModel: '/avatars/realistic-male.glb',
			ctaPrimary: { label: 'Open the Tour Builder', href: '/tour-builder' },
		},
		{
			slug: 'first-agent',
			tier: 'middle',
			title: 'Build your first agent (from scratch)',
			blurb: 'A complete walkthrough from a blank HTML file to a live, talking 3D character you wrote yourself — no framework, no build tools.',
			builds: 'A self-hosted index.html with a working talking agent',
			time: '40 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Read the source', href: '/docs/tutorials/first-agent' },
		},
		{
			slug: 'embed-on-website',
			tier: 'middle',
			title: 'Embed on a website (HTML, React, Next.js)',
			blurb: 'Five different ways to add an agent to your site — pick the one that matches how you build today.',
			builds: 'A production-ready embed in your existing stack',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Embed docs', href: '/docs/embedding' },
		},
		{
			slug: 'personal-ai-site',
			tier: 'middle',
			title: 'Build a personal AI website',
			blurb: 'A 3D version of you, on your domain, ready to answer any question about your work — with a portfolio, contact form, and resume.',
			builds: 'A complete personal site at yourname.com powered by an agent',
			time: '60 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Create your agent', href: '/create' },
		},
		{
			slug: 'js-api-events',
			tier: 'middle',
			title: 'Drive the agent with the JavaScript API',
			blurb: 'Listen for the ready event, play animations on demand, make the agent speak from anywhere in your app code.',
			builds: 'An agent driven by your app — clicks, scrolls, form submits',
			time: '25 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'JS API reference', href: '/docs/js-api' },
		},
		{
			slug: 'web-component-end-to-end',
			tier: 'middle',
			title: 'Use the <agent-3d> web component end-to-end',
			blurb: 'Skip the script tag — drop a real custom element into your DOM, bind attributes, and use the full event lifecycle.',
			builds: 'A reusable <agent-3d> tag wired into your component system',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Web component docs', href: '/docs/web-component' },
		},
		{
			slug: 'build-a-site-concierge',
			tier: 'middle',
			title: 'Build a site concierge from the building blocks',
			blurb: 'How the Concierge widget is assembled: the talking avatar, the streaming chat, the tool calls, and how to point the same parts at your own backend over Server-Sent Events.',
			builds: 'Your own concierge widget, wired to your own backend',
			time: '35 min',
			previewModel: '/avatars/selfie-girl.glb',
			ctaPrimary: { label: 'Open the Concierge', href: '/concierge' },
		},
		{
			slug: 'trigger-from-page-events',
			tier: 'middle',
			title: 'Trigger the agent from page events',
			blurb: 'Make your agent react to clicks, scrolls, form submits, and route changes — turn it into a real co-pilot, not a chat widget.',
			builds: 'An agent that reacts to the user journey on your site',
			time: '25 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'JS API reference', href: '/docs/js-api' },
		},
		{
			slug: 'character-library-to-embed',
			tier: 'middle',
			title: 'From the character library to a live embed',
			blurb: 'Pick a rigged character from the free library of 107, prove its skeleton drives the clip library, and put it on your own page with one script tag. Includes the CORS fix that only bites after you deploy.',
			builds: 'A rigged, animated character on your own site, waving on a button click',
			time: '10 min',
			previewModel: '/avatars/xbot.glb',
			ctaPrimary: { label: 'Browse the library', href: '/character-library' },
		},
		{
			slug: 'render-avatar-images',
			tier: 'middle',
			title: 'Put a 3D avatar in an <img> tag',
			blurb: 'Render any public avatar as a PNG, JPEG, or WebP from a URL: four camera framings, 28 poses, ARKit facial morphs, social cards, and turntables. No 3D engine anywhere in your stack.',
			builds: 'Posed, expressive avatar images for pages, cards, and email',
			time: '20 min',
			previewModel: '/avatars/selfie-girl.glb',
			ctaPrimary: { label: 'Browse public avatars', href: '/gallery' },
		},
		{
			slug: 'generate-3d-api',
			tier: 'middle',
			title: 'Generate 3D models from code',
			blurb: 'The Forge as a plain HTTP API — submit a prompt, poll the job, download the GLB. Batch asset packs, photo uploads, and x402 paid calls for agents.',
			builds: 'A script that turns a prompt list into a folder of GLB files',
			time: '25 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open the Forge', href: '/forge' },
		},
		{
			slug: 'grok-bot-recipes',
			tier: 'middle',
			title: 'Six Grok Bot recipes, proven not imagined',
			blurb: 'Six working Grok Bot workflows run against live production: a daily 3D brief, a game-jam asset pack, an avatar from a photo, an X post\'s image turned into a 3D model, a weekly agent report over OAuth, and a Solana-first $THREE market brief.',
			builds: 'Six real Grok Bot recipes with the exact tool calls and output each one returned',
			time: '15 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open /grok', href: '/grok' },
		},
		{
			slug: 'upload-custom-glb',
			tier: 'middle',
			title: 'Upload a custom GLB avatar',
			blurb: 'Bring your own model — any glTF 2.0 .glb from Blender, three.ws Studio, or any other source. Get it validated, fixed, and live.',
			builds: 'A fully custom avatar body running in production',
			time: '35 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Validator', href: '/validation' },
		},
		{
			slug: 'agent-personality',
			tier: 'middle',
			title: 'Give your agent a personality',
			blurb: 'System prompt design, voice & tone, memory of past conversations, refusal patterns — make your agent feel like a real character.',
			builds: 'A distinct, on-brand persona that holds across thousands of chats',
			time: '40 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Agent system docs', href: '/docs/agent-system' },
		},
		{
			slug: 'connect-ai-brain',
			tier: 'middle',
			title: 'Connect Anthropic, OpenAI, or xAI as the brain',
			blurb: 'Plug your own model provider into the agent loop. Bring your API key, choose your model, control cost and latency.',
			builds: 'An agent powered by the model you choose, billed to your account',
			time: '30 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open My Agents', href: '/my-agents' },
		},
		{
			slug: 'create-and-edit-memory',
			tier: 'middle',
			title: 'Create, enhance & edit agent memory',
			blurb: 'Teach an agent a fact that sticks between sessions — five ways: the dashboard, the agent itself, MCP tools, the REST API, and from a skill. Plus how to sharpen, edit, and forget.',
			builds: 'An agent that remembers your preferences and corrections across every conversation',
			time: '25 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open Library', href: '/dashboard/library#tab=memory' },
		},
		{
			slug: 'animate-your-avatar',
			tier: 'middle',
			title: 'Animate your avatar',
			blurb: 'Apply the pre-baked clip library to any humanoid rig in the Animation Studio — browse, preview, retarget idle/walk/emotes onto your model, and export an animated GLB.',
			builds: 'Your avatar playing the full motion library, exported as an animated GLB',
			time: '20 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open Animation Studio', href: '/pose' },
		},
		{
			slug: 'build-a-scene',
			tier: 'middle',
			title: 'Build a 3D scene in Scene Studio',
			blurb: 'Import GLBs, arrange objects, tune materials and lights, and export — a full three.js scene editor running in the browser.',
			builds: 'A composed 3D scene exported as a GLB',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Scene Studio', href: '/scene' },
		},
		{
			slug: 'place-agent-irl',
			tier: 'middle',
			title: 'Place your agent in the real world (IRL)',
			blurb: 'Use camera passthrough, a joystick, and tap-to-place to drop your 3D agent into your physical space — and understand how location privacy works.',
			builds: 'Your agent standing in your real room, pinned to a place',
			time: '15 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open IRL', href: '/irl' },
		},
		{
			slug: 'voice-and-lipsync',
			tier: 'middle',
			title: 'Give your agent a voice with lipsync',
			blurb: 'Add real-time text-to-speech with synchronized mouth movement — pick or clone a voice, drive visemes from audio, and wire it into a live agent.',
			builds: 'An agent that speaks out loud with its mouth in sync',
			time: '25 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open Voice Lab', href: '/voice' },
		},
		{
			slug: 'pay-for-x402-service',
			tier: 'middle',
			title: 'Discover and pay for an x402 service',
			blurb: 'Browse the x402 Bazaar and call a paid API from your agent — the 402 challenge, the USDC payment, and the retry, end to end.',
			builds: 'Your agent paying USDC to call a real x402 endpoint',
			time: '30 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open the Bazaar', href: '/bazaar' },
		},
		{
			slug: 'earn-and-spend-in-play',
			tier: 'middle',
			title: 'Earn and spend in /play',
			blurb: "Run the full economic loop in the open world: gather raw materials, sell them to a vendor, buy a better tool, bank the rest so death can't take it, and spin the wheel. Covers why the world has two currencies that never touch, and why the server decides every price.",
			builds: 'A funded character who has run the whole gather → sell → bank loop',
			time: '25 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open /play', href: '/play' },
		},
		{
			slug: 'connect-your-home',
			tier: 'middle',
			title: 'Connect your home',
			blurb: 'Point your agent at a real Home Assistant and it runs your actual house: lights, thermostat, and the scenes you already built. Covers the three honest ways to reach a house that lives on a home network, and the rule that unlocking, opening and disarming always stop and ask, while locking up never does. Ends with sharing the house: five roles, per-person scopes, and why a house sitter can turn a light on and can never open the front door.',
			builds: 'A house your agent can run, shared with the people who live in it',
			time: '20 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Connect a home', href: '/smart-home' },
		},

		/* ───────────────────────── ADVANCED ───────────────────────── */
		{
			slug: 'emotion-from-data',
			tier: 'advanced',
			title: 'Animations from data: wire your agent\'s gestures to real APIs and AI',
			blurb: 'Trigger real body animations — celebrate, dance, flinch — from a live data feed. A free lexicon lane to prove the wiring, then a real AI model classifying arbitrary text into a richer set of gestures, with cooldown/dedupe so a fast feed never spams the queue.',
			builds: 'An agent that physically reacts to a live data feed through real AI',
			time: '25 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Browse the animation library', href: '/animations' },
		},
		{
			slug: 'custom-skill',
			tier: 'advanced',
			title: 'Build a custom skill',
			blurb: 'A complete walkthrough of building a weather skill an agent can invoke — bundle format, LLM tool calling, context API.',
			builds: 'A live weather skill bundled, deployed, and callable by the agent',
			time: '60 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Skills docs', href: '/docs/skills' },
		},
		{
			slug: 'sell-a-skill-with-a-trial',
			tier: 'middle',
			title: 'Sell a skill with a free trial that converts',
			blurb: 'List a skill in $THREE, give buyers a metered free trial, and watch it expire into a real on-chain purchase. Includes the missing decrement that quietly makes trials unsellable.',
			builds: 'A listed skill whose free trial expires into a paid, on-chain sale',
			time: '15 min',
			previewModel: '/avatars/michelle.glb',
			ctaPrimary: { label: 'Open the marketplace', href: '/marketplace' },
		},
		{
			slug: 'register-onchain',
			tier: 'advanced',
			title: 'Register your agent on-chain (ERC-8004)',
			blurb: 'Give your agent a permanent, verifiable identity. Publish an ERC-8004 attestation anyone can read from any chain.',
			builds: 'A registered agent identity discoverable from any wallet',
			time: '45 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'ERC-8004 docs', href: '/docs/erc8004' },
		},
		{
			slug: 'mint-pumpfun-token',
			tier: 'advanced',
			title: 'Mint an agent token on Pump.fun',
			blurb: 'Launch a Solana token for your agent, bond it to its on-chain identity, and let people speculate on (or hold) a piece of it.',
			builds: 'A live Pump.fun token bonded to your agent identity',
			time: '50 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Pump.fun stream', href: '/pumpfun' },
		},
		{
			slug: 'paid-x402-endpoint',
			tier: 'advanced',
			title: 'Build a paid x402 endpoint your agent calls',
			blurb: 'Stand up an API that other agents pay USDC to call — using the x402 protocol on Base mainnet. Real money, real flow.',
			builds: 'A revenue-generating paid API, callable agent-to-agent',
			time: '75 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'See paid calls', href: '/pay/calls' },
		},
		{
			slug: 'monetize-mcp-server',
			tier: 'advanced',
			title: 'Monetize an MCP server: charge per tool call',
			blurb: 'Build an MCP server whose tools charge other agents per call in USDC on Solana. One free orientation tool, one paid tool that does real work, and a test that proves the product never escapes unpaid.',
			builds: 'A revenue-generating MCP server any assistant can buy from',
			time: '40 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Read the example code', href: 'https://github.com/nirholas/three.ws/tree/main/examples/paid-mcp-server' },
		},
		{
			slug: 'wallet-sign-in',
			tier: 'middle',
			title: 'Add wallet sign-in to your app',
			blurb: 'Authenticate visitors with Phantom, Backpack, Solflare, or MetaMask. The Sign-In with Solana round trip end to end, plus the four things that quietly break it: the domain check that rejects dev origins, the CSRF header on verify, the two different signed-out responses, and error codes that arrive in a field most people read wrong.',
			builds: 'A working wallet sign-in button that produces a real three.ws session',
			time: '20 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Run the example', href: 'https://github.com/nirholas/three.ws/tree/main/examples/wallet-sign-in' },
		},
		{
			slug: 'build-a-3d-asset-pipeline',
			tier: 'middle',
			title: 'Build a 3D asset pipeline',
			blurb: 'Four stages from one prompt to a CI gate: generate a model on the command line, fan a prompt list out in parallel with a manifest and a gallery, refuse to ship anything over budget, then hand the whole pipeline to an AI assistant as an MCP tool. Standard library only, no API key.',
			builds: 'A regenerable asset folder plus a CI check that blocks bad models',
			time: '25 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the Cookbook', href: '/cookbook' },
		},
		{
			slug: 'agent-spending-envelope',
			tier: 'advanced',
			title: 'Give an agent a spending envelope (no private key)',
			blurb: 'Fund a budget from prepaid credits, hand the agent a capped bearer token, and let it buy real x402 services while a spend governor enforces your total, your per-call ceiling, your host allowlist, and your expiry. Cancel to refund the rest.',
			builds: 'An agent that spends real money inside hard limits, with a full audit ledger',
			time: '35 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Open credits', href: '/credits' },
		},
		{
			slug: 'x402-server-sdk',
			tier: 'advanced',
			title: 'Meter any API with the x402-server SDK',
			blurb: 'Turn an ordinary HTTP handler into a paid one with @three-ws/x402-server. Solana-first, framework-agnostic, and runnable offline before you touch a wallet.',
			builds: 'A paid endpoint charging USDC or $THREE, in a few lines',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Package on npm', href: 'https://www.npmjs.com/package/@three-ws/x402-server' },
		},
		{
			slug: 'nvidia-nim-self-host',
			tier: 'advanced',
			title: 'Run Microsoft TRELLIS on your own NVIDIA NIM',
			blurb: 'Self-host the TRELLIS NIM container on an NVIDIA GPU, point three.ws at it, and reconstruct a textured GLB from a prompt or a photo in one synchronous /v1/infer call.',
			builds: 'Your own NVIDIA NIM serving text- and image-to-3D, wired into three.ws',
			time: '60 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open the NIM demo', href: '/forge-nim' },
		},
		{
			slug: 'self-host-agent-backend',
			tier: 'advanced',
			title: 'Self-host the agent backend',
			blurb: 'Run the full three.ws backend on your own infrastructure — workers, function endpoints, model proxies. No three.ws dependency in production.',
			builds: 'A fully independent agent stack running on your own servers',
			time: '90 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Architecture docs', href: '/docs/architecture' },
		},
		{
			slug: 'multi-agent-coordination',
			tier: 'advanced',
			title: 'Multi-agent coordination',
			blurb: 'Two or more agents on the same page that talk to each other — turn-taking, shared memory, delegating subtasks.',
			builds: 'A team of agents that collaborate to solve a single task',
			time: '60 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Multi-agent docs', href: '/docs/multi-agent' },
		},
		{
			slug: 'mcp-server-for-your-agent',
			tier: 'advanced',
			title: 'Expose your agent as an MCP server',
			blurb: 'Wrap your agent in the Model Context Protocol so any MCP-compatible client (Claude Desktop, Cursor, etc.) can drive it.',
			builds: 'Your agent reachable as a tool from any MCP-aware app',
			time: '45 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'MCP docs', href: '/docs/mcp' },
		},
		{
			slug: 'skill-with-database-auth',
			tier: 'advanced',
			title: 'Custom skill with database + auth',
			blurb: 'A real production skill — Postgres-backed CRM lookup, signed requests, per-user permissions, rate limits. Not a toy weather demo.',
			builds: 'A production CRM-lookup skill with auth and rate limits',
			time: '90 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Skills docs', href: '/docs/skills' },
		},
		{
			slug: 'deploy-to-vercel-custom-domain',
			tier: 'advanced',
			title: 'Deploy to Vercel with a custom domain',
			blurb: 'Take a forked three.ws and ship it as agent.yourcompany.com — CI, environment variables, custom domain, SSL, the lot.',
			builds: 'A live agent on agent.yourcompany.com with CI and SSL',
			time: '45 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Deployment docs', href: '/docs/deployment' },
		},
		{
			slug: 'claim-threews-name',
			tier: 'advanced',
			title: 'Claim a .threews.sol name & get paid by name',
			blurb: 'Mint a *.threews.sol Solana subdomain for your agent and accept USDC payments addressed to the name instead of a raw wallet.',
			builds: 'A human-readable .threews.sol name that resolves to your agent and receives payments',
			time: '40 min',
			previewModel: '/avatars/cz.glb',
			ctaPrimary: { label: 'Claim a name', href: '/threews/claim' },
		},
		{
			slug: 'agent-reputation',
			tier: 'advanced',
			title: "Read an agent's on-chain reputation (ERC-8004)",
			blurb: 'Explore and read ERC-8004 reputation — how feedback and attestations accrue, and how to query an agent\'s score from code, the API, or MCP.',
			builds: 'A reputation read on any registered agent, on-chain and via API',
			time: '35 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open Reputation Explorer', href: '/reputation' },
		},
		{
			slug: 'solana-agent-reputation',
			tier: 'advanced',
			title: "Read a Solana agent's reputation (the Passport)",
			blurb: 'Read a Solana agent\'s A–D trust grade and the attestations behind it, then leave your own on-chain vouch — backed by SOL stake if you want it to count for more.',
			builds: 'A full read of a Solana agent\'s trust record, plus your own on-chain attestation',
			time: '30 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Open the Agent Passport', href: '/agent-passport.html' },
		},
		{
			slug: 'mine-vanity-address',
			tier: 'advanced',
			title: 'Mine a Solana vanity address',
			blurb: 'Grind a custom-prefix Solana address in the browser, then prove how it was made with the proof-of-grind receipt, gallery, and bounty market.',
			builds: 'A vanity Solana address with a verifiable proof-of-grind receipt',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Vanity Wallet', href: '/vanity-wallet' },
		},
		{
			slug: 'arm-an-agent-sniper',
			tier: 'advanced',
			title: 'Arm an Autonomous Sniper on Your Agent',
			blurb: 'Fund your agent\'s wallet and arm it to trade fresh pump.fun launches on its own: entry filters, an on-chain safety simulation before every buy, a strict exit ladder, and a hash-chained decision ledger you can audit trade by trade.',
			builds: 'A live autonomous sniper strategy trading real SOL from your agent\'s wallet',
			time: '30 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open Mission Control', href: '/terminal' },
		},
		{
			slug: 'find-a-better-exit-policy',
			tier: 'advanced',
			title: 'Find a Better Exit Policy From Trades You Already Made',
			blurb: 'Take the fleet\'s real closed positions and re-run them under different exit rules in the Exit Lab: which knob to move, by how much, and exactly what a counterfactual replay can and cannot claim.',
			builds: 'An exit policy proven against your own trade history, not opinions',
			time: '20 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open the Exit Lab', href: '/exit-lab' },
		},
		{
			slug: 'read-the-trading-fleet',
			tier: 'advanced',
			title: 'Read the trading fleet: a working strategy vs a lucky one',
			blurb: 'The numbers that feel most convincing are the ones that lie most often. Which single figure tells you a fleet is alive, why uptime is not it, and how to read the public ledger without arming anything.',
			builds: 'The judgement to tell a real edge from a hot streak',
			time: '25 min',
			previewModel: '/animations/soldier.glb',
			ctaPrimary: { label: 'Open the arena', href: '/arena' },
		},
		{
			slug: 'ship-an-avatar-manifest',
			tier: 'advanced',
			title: 'Ship an avatar manifest',
			blurb: 'Turn a raw GLB into a signed-off, hash-anchored manifest: one document that names the avatar, records the exact bytes of its mesh, declares its skeleton, and fails your build if the model ever silently changes.',
			builds: 'A verifiable avatar artifact plus a release check that catches drift',
			time: '30 min',
			previewModel: '/avatars/mannequin.glb',
			ctaPrimary: { label: 'Read the manifest spec', href: '/docs/agent-manifest' },
		},
		{
			slug: 'write-a-guard',
			tier: 'advanced',
			title: 'Write a repository guard',
			blurb: 'This repo has no CI, so a guard is the only thing between a mistake and production. Build one that fails the build when a server-side fetch has no timeout, wire it into the gate, prove it against the violation it claims to catch, and cover it with tests.',
			builds: 'A real guard running in the gate, listed on /guards',
			time: '20 min',
			previewModel: '/animations/robotexpressive.glb',
			ctaPrimary: { label: 'Browse the guards', href: '/guards' },
		},
	];

	const TIER_META = {
		easy: {
			label: 'Easy',
			eyebrow: 'No-code · 5–10 min',
			blurb: 'Copy-paste and click. Zero code. If you can edit an HTML file (or use a CMS), you can do these.',
			accent: '#ffffff',
			accentSoft: 'rgba(255, 255, 255, 0.16)',
			accentBorder: 'rgba(255, 255, 255, 0.32)',
		},
		middle: {
			label: 'Middle',
			eyebrow: 'HTML & JS · 15–40 min',
			blurb: 'You write some code. Comfortable with HTML and a bit of JavaScript? Start here.',
			accent: '#cccccc',
			accentSoft: 'rgba(255, 255, 255, 0.16)',
			accentBorder: 'rgba(255, 255, 255, 0.32)',
		},
		advanced: {
			label: 'Advanced',
			eyebrow: 'Real engineering · 45+ min',
			blurb: 'Backend, on-chain, and real production concerns. Bring a Node toolchain and a server.',
			accent: '#fbbf24',
			accentSoft: 'rgba(251, 191, 36, 0.16)',
			accentBorder: 'rgba(251, 191, 36, 0.32)',
		},
	};

	function tutorialBySlug(slug) {
		return TUTORIALS.find((t) => t.slug === slug) || null;
	}

	function tutorialIndex(slug) {
		return TUTORIALS.findIndex((t) => t.slug === slug);
	}

	function tutorialsByTier(tier) {
		return TUTORIALS.filter((t) => t.tier === tier);
	}

	window.TUTORIALS = TUTORIALS;
	window.TUTORIAL_TIERS = TIER_META;
	window.tutorialBySlug = tutorialBySlug;
	window.tutorialIndex = tutorialIndex;
	window.tutorialsByTier = tutorialsByTier;
})();