Skip to content
← Public packages

@kentcdodds/kody-connect-talk

Kent C. Dodds's Cloudflare Connect 2026 talk: why your agents' stuff needs a common house, and how Kody builds one on Cloudflare.

FollowForkOpen app

Files

slides.mjs

1607 lines · 74.9 KB · JavaScript
// The deck, in order. Each slide is one HyperFrames scene.
//
//   holds  local times (s) the presenter stops at: the first is the slide's
//          rest frame, each later one is a click-to-reveal step
//   dur    local scene length; the default exit plays in the last 0.5s
//   anim   (T, H) => void — T is the scene's absolute start; H is the motion
//          vocabulary from page.js. Serialized with toString(), so it must
//          only use its parameters.
//   enter  'wipe' — the topic hue collapses into the wayfinding badge
//   exit   'wipe' — the next topic's hue grows to fill the frame
import {
	html,
	orb,
	badge,
	agent,
	cfLogo,
	cursor,
	person,
	house,
	code,
	term,
	diagram,
	wayfind,
	esc,
	TOPIC_NAMES,
} from './lib.mjs'

import WAITING_ROOM from './waiting-room.json' with { type: 'json' }

const FEATURE_ORBS = ['memory', 'packages', 'triggers', 'credentials', 'apps']

// ---------------------------------------------------------------- shared shapes

function topicCard(topic, notes) {
	return {
		id: `${topic}-card`,
		label: TOPIC_NAMES[topic],
		topic,
		tinted: true,
		notes,
		html: html`
			<div class="card-badge" id="${topic}-card-badge" style="position:absolute;left:0;right:0;top:200px;display:flex;justify-content:center">
				${badge(topic, 380)}
			</div>
			<div class="display" id="${topic}-card-word" style="position:absolute;left:0;right:0;top:640px;text-align:center;font-weight:760;font-size:180px;letter-spacing:-0.035em">
				${TOPIC_NAMES[topic]}
			</div>`,
		steps: [
			(H, id) => {
				H.in(`#s-${id} .card-badge`, 0.15, { scale: 0.55, y: 0, d: 0.9 })
				H.in(`#s-${id} .display`, 0.3, { y: 40 })
			},
		],
	}
}

// ---------------------------------------------------------------- slides

export const slides = [
	// ============================================================ title
	{
		id: 'title',
		label: 'Title',
		connect: true,
		exit: 'wipe',
		wipeColor: 'page',
		notes:
			"While the room fills, the word Personal glitches into Team and back, and the subtitle types one terrible automation after another, in a new random order every time. (When it's time) Hi, I'm Kent. I teach people how to build software. Lately I've been building Kody. This talk is about giving every person, and every team, their own software ecosystem, and why Cloudflare is the only place I could build it.",
		html: html`
			<div class="cx-top cx-in">
				<span class="cx-track"><img src="assets/img/connect-cloud-white.svg" alt="" />Agent Cloud</span>
				<img class="cx-mark" src="assets/img/connect-cloud-white.svg" alt="Cloudflare" />
			</div>
			<h1 class="cx-h1" id="title-h" style="position:absolute;left:96px;top:250px;width:1180px">
				<span>I Built Your <span class="cx-swap" data-swap data-text="Personal">Personal</span></span>
				<span>Software Ecosystem</span>
			</h1>
			<p class="cx-sub" id="title-sub" style="position:absolute;left:96px;top:540px;width:1240px"><span data-typer></span><span class="caret"></span></p>
			<script type="application/json" id="cx-lines">${JSON.stringify(WAITING_ROOM)}</script>
			<div id="title-kody" style="position:absolute;right:70px;top:170px;width:640px;height:640px">
				<img class="amb-sway" src="assets/img/kody-greeting.webp" alt="Kody the koala waving" style="width:100%;height:100%" />
			</div>
			<div class="cx-speaker cx-in">
				<img src="assets/img/kent.jpg" alt="Kent C. Dodds" />
				<div>
					<div class="cx-name">Kent C. Dodds</div>
					<div class="cx-role">Founder, kody.codes</div>
				</div>
			</div>
			<div class="cx-wordmark cx-in">connect 2026</div>`,
		steps: [
			(H) => {
				H.in('#s-title .cx-top', 0.05)
				H.in('#title-h', 0.1, { d: 0.9 })
				H.fade('#title-sub', 0.35)
				H.in('#title-kody', 0.2, { y: 60, scale: 0.92, d: 1 })
				H.in(['#s-title .cx-speaker', '#s-title .cx-wordmark'], 0.4, { stagger: 0.08 })
			},
		],
	},

	// ============================================================ the story
	{
		id: 'one-house',
		label: "Your agent's house",
		notes:
			"Start with you and one agent. It's great. (Click) Over time it fills up with your stuff: memories, packages, triggers, connected accounts, apps. You're living in your agent's house.",
		html: html`
			<h2 class="headline">You live in your <em>agent's</em> house.</h2>
			${house({
				id: 'oh-house',
				x: 700,
				y: 330,
				agent: agent('story', 0, 92),
				room: ['memory', 'packages', 'triggers', 'credentials', 'apps'].map((o) => orb(o, 96, { cls: 'oh-orb' })).join(''),
			})}
			${person('', { id: 'oh-you', name: 'You', style: 'left:430px;top:650px' })}
			<div class="label muted" id="oh-stuff" style="position:absolute;left:1300px;top:640px;width:480px;line-height:1.4">
				memory · packages · triggers · credentials · apps
			</div>`,
		steps: [
			(H) => {
				H.in('#oh-house', 0.1)
				H.in('#oh-you', 0.3, { x: -40, y: 0 })
			},
			(H) => {
				H.in('.oh-orb', 0.25, { scale: 0.4, y: 0, d: 0.6, stagger: 0.12 })
				H.fade('#oh-stuff', 0.9)
			},
		],
	},
	{
		id: 'switch',
		label: 'Switching agents',
		notes:
			"Problem one. A better agent comes out, or you just want to try a different one. (Click) You can move. Your stuff can't. It's locked in the old house.",
		html: html`
			<h2 class="headline">Switch agents. <em>Your stuff stays behind.</em></h2>
			${house({
				id: 'sw-a',
				x: 260,
				y: 330,
				agent: agent('story', 0, 92),
				roomId: 'sw-orbs',
				room: ['memory', 'packages', 'triggers', 'credentials', 'apps'].map((o) => orb(o, 76)).join(''),
				extra: html`<div id="sw-lock" style="position:absolute;left:200px;top:300px;width:120px;height:120px">
					<svg viewBox="0 0 24 24" style="width:120px;height:120px"><rect x="4" y="10.5" width="16" height="11" rx="2.5" fill="var(--danger)"/><path d="M7.5 10.5V7.5a4.5 4.5 0 0 1 9 0v3" fill="none" stroke="var(--danger)" stroke-width="2.4"/></svg>
				</div>`,
			})}
			${house({ id: 'sw-b', x: 1140, y: 330, agent: agent('story', 1, 92) })}
			${person('', { id: 'sw-you', name: 'You', style: 'left:464px;top:740px' })}
			<style>#sw-orbs{flex-wrap:nowrap;gap:12px;bottom:130px}</style>`,
		steps: [
			(H) => {
				H.in('#sw-a', 0.1)
				H.in('#sw-b', 0.25)
				H.fade('#sw-you', 0.35)
				H.fromTo('#sw-lock', 0, { opacity: 0, scale: 0.5 }, { opacity: 0, scale: 0.5, duration: 0.01 })
			},
			(H) => {
				H.fromTo('#sw-you', 0.3, { x: 0 }, { x: 880, duration: 1.0, ease: 'power3.inOut' })
				H.dim('#sw-orbs', 1.1, { to: 0.25, blur: 2 })
				H.to('#sw-lock', 1.3, { opacity: 1, scale: 1, duration: 0.5, ease: 'expo.out' })
			},
		],
	},
	{
		id: 'teammate',
		label: 'Teammates',
		notes:
			"Problem two. Your teammate lives in a different house, built by a different agent, full of their own stuff. (Click) You can't share what you built. Neither of you can come over.",
		html: html`
			<h2 class="headline">Your teammate <em>lives somewhere else.</em></h2>
			${house({
				id: 'tm-a',
				x: 260,
				y: 330,
				agent: agent('story', 0, 92),
				room: person() + ['memory', 'packages', 'apps'].map((o) => orb(o, 96)).join(''),
			})}
			${house({
				id: 'tm-b',
				x: 1140,
				y: 330,
				agent: agent('story', 2, 92),
				room: person('blue') + ['triggers', 'credentials', 'memory'].map((o) => orb(o, 96)).join(''),
			})}
			<div id="tm-wall" style="position:absolute;left:810px;top:500px;width:300px;height:300px">
				<svg viewBox="0 0 300 300" style="width:300px;height:300px">
					<path d="M0 150 H300" stroke="var(--line-strong)" stroke-width="8" stroke-dasharray="18 18" fill="none"/>
					<circle cx="150" cy="150" r="70" fill="var(--bg)" stroke="var(--danger)" stroke-width="10"/>
					<path d="M120 120 L180 180 M180 120 L120 180" stroke="var(--danger)" stroke-width="14" stroke-linecap="round"/>
				</svg>
			</div>`,
		steps: [
			(H) => {
				H.in('#tm-a', 0.1)
				H.in('#tm-b', 0.25)
			},
			(H) => {
				H.in('#tm-wall', 0.6, { scale: 0.6, y: 0, d: 0.6 })
			},
		],
	},
	{
		id: 'common-house',
		label: 'Kody: the common house',
		notes:
			"Kody is a common house. Everyone gets their own room for their own stuff. (Click) Any agent can walk in the front door: Claude Code, Codex, Grok Bot, whatever comes next. (Click) And you can share anything you've built with any teammate. (Click) And some things belong to the whole house: an org's packages, connections, and secrets, shared by everyone in it. Kody isn't another agent. It's the software platform underneath all of them.",
		html: html`
			<h2 class="headline">Kody is <em>the common house.</em></h2>
			<div id="ch-house" style="position:absolute;left:260px;top:220px;width:1400px;height:640px">
				<svg viewBox="0 0 1400 640" style="position:absolute;inset:0;width:100%;height:100%;overflow:visible">
					<path class="house-shape" d="M20 230 L700 20 L1380 230 V620 H20 Z" />
					<path d="M480 250 V600 M920 250 V600" stroke="var(--line)" stroke-width="6" />
					<rect class="ch-door" x="198" y="528" width="70" height="92" rx="8" fill="var(--bg)" stroke="var(--line)" stroke-width="6" />
					<rect class="ch-door" x="665" y="528" width="70" height="92" rx="8" fill="var(--bg)" stroke="var(--line)" stroke-width="6" />
					<rect class="ch-door" x="1132" y="528" width="70" height="92" rx="8" fill="var(--bg)" stroke="var(--line)" stroke-width="6" />
				</svg>
				<img class="amb-float" src="assets/img/kody-mark.png" alt="Kody" style="position:absolute;left:590px;top:100px;width:96px;height:96px" />
				<svg id="ch-share-lines" viewBox="0 0 1400 640" style="position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none">
					${[260, 700, 1140].map((x) => `<path class="wire" d="M764 196 C764 230 ${x} 220 ${x} 256" style="stroke:var(--accent)" />`).join('')}
				</svg>
				${orb('packages', 96, { id: 'ch-org-pkg', cls: 'ch-shared' })}
				<div style="position:absolute;left:40px;right:40px;top:262px;display:flex">
					${[
						['', ['apps', 'memory', 'packages'], 'ch-src'],
						['blue', ['triggers', 'credentials'], 'ch-share-1'],
						['amber', ['memory', 'secrets'], 'ch-share-2'],
					]
						.map(
							([c, orbs, shareId]) => html`<div style="flex:1;display:flex;flex-direction:column;align-items:center;gap:24px">
								${person(c)}
								<div style="display:flex;gap:14px">
									${orbs.map((o, i) => orb(o, 96, { id: i === 0 && shareId === 'ch-src' ? 'ch-src' : '' })).join('')}
									${shareId === 'ch-src' ? '' : orb('apps', 96, { id: shareId, cls: 'ch-shared' })}
								</div>
							</div>`,
						)
						.join('')}
				</div>
			</div>
			${[
				[520, 2],
				[960, 3],
				[1400, 1],
			]
				.map(
					([cx, count], room) =>
						`<div class="ch-agent" style="position:absolute;left:${cx - 220}px;width:440px;top:878px;display:flex;justify-content:center;gap:28px">${Array.from({ length: count }, (_, i) => agent(`room${room}`, i, 76, { cls: 'agent-swap' })).join('')}</div>`,
				)
				.join('')}
			<style>
				.ch-shared .mark { outline: 5px solid var(--accent); outline-offset: 6px; }
				#ch-org-pkg { position: absolute; left: 716px; top: 100px; }
			</style>`,
		steps: [
			(H) => {
				H.in('#ch-house', 0.1)
				H.fromTo(['#ch-share-1', '#ch-share-2'], 0, { opacity: 0 }, { opacity: 0, duration: 0.01 })
				// org-wide: a package that belongs to the house, not a room
				H.fromTo(['#ch-org-pkg', '#ch-share-lines'], 0, { opacity: 0 }, { opacity: 0, duration: 0.01 })
			},
			(H) => {
				H.in('.ch-agent', 0.6, { stagger: 0.12, d: 0.6 })
				H.fromTo('.ch-door', 0.8, { fill: 'var(--bg)' }, { fill: 'var(--accent-soft)', stroke: 'var(--accent)', duration: 0.4, stagger: 0.12 })
			},
			(H) => {
				H.fromTo('#ch-share-1', 0.5, { opacity: 0, scale: 0.4, x: -550 }, { opacity: 1, scale: 1, x: 0, duration: 0.8, ease: 'power3.inOut' })
				H.fromTo('#ch-share-2', 0.7, { opacity: 0, scale: 0.4, x: -990 }, { opacity: 1, scale: 1, x: 0, duration: 0.9, ease: 'power3.inOut' })
			},
			(H) => {
				H.fromTo('#ch-org-pkg', 0.3, { opacity: 0, scale: 0.4 }, { opacity: 1, scale: 1, duration: 0.7, ease: 'expo.out' })
				H.fade('#ch-share-lines', 0.6, { d: 0.5 })
			},
		],
	},
	{
		id: 'roadmap',
		label: 'Roadmap',
		exit: 'wipe',
		wipeFrom: [520, 336],
		nextTopic: 'search',
		notes:
			"Here's the rest of the talk. Every agent gets two tools: search and execute. (Click) They're available through three doors: MCP, the CLI, and a plain HTTP API. (Click) Then the things you keep in your room. For each one: the problem, how Kody solves it, and how it works under the hood on Cloudflare.",
		html: html`
			<h2 class="headline">Kody is <em>your software platform.</em></h2>
			<div style="position:absolute;left:120px;top:280px;display:flex;align-items:center;gap:40px">
				<div class="label muted" style="width:300px;white-space:nowrap">Two tools</div>
				${['search', 'execute']
					.map(
						(t) => `<div class="chip rm-surface t-${t}" style="font-size:52px;padding:18px 40px 18px 22px;gap:20px">${badge(t, 76, { float: false })}<span>${TOPIC_NAMES[t]}</span></div>`,
					)
					.join('')}
			</div>
			<div style="position:absolute;left:120px;top:430px;display:flex;align-items:center;gap:40px">
				<div class="label muted" id="rm-doors" style="width:300px;white-space:nowrap">Three doors</div>
				${['mcp', 'cli', 'api']
					.map(
						(t) => `<div class="chip rm-door t-${t}" style="font-size:52px;padding:18px 40px 18px 22px;gap:20px">${badge(t, 76, { float: false })}<span>${TOPIC_NAMES[t]}</span></div>`,
					)
					.join('')}
			</div>
			<div style="position:absolute;left:120px;top:600px;display:flex;align-items:center;gap:40px">
				<div class="label muted" id="rm-keep" style="width:300px">Keep</div>
				${FEATURE_ORBS.map(
					(o) => `<div class="rm-feat" style="display:flex;flex-direction:column;align-items:center;gap:14px;width:240px">${orb(o, 170)}<div class="label">${TOPIC_NAMES[o]}</div></div>`,
				).join('')}
			</div>`,
		steps: [
			(H) => {
				H.in('.rm-surface', 0.15, { stagger: 0.1 })
				H.fromTo(['#rm-doors', '.rm-door', '#rm-keep', '.rm-feat'], 0, { opacity: 0 }, { opacity: 0, duration: 0.01 })
			},
			(H) => {
				H.fade('#rm-doors', 0.1)
				H.in('.rm-door', 0.15, { stagger: 0.1 })
			},
			(H) => {
				H.fade('#rm-keep', 0.5)
				H.in('.rm-feat', 0.55, { stagger: 0.1, scale: 0.7, y: 0 })
			},
		],
	},

	// ============================================================ search
	topicCard(
		'search',
		"First door: search. Agents can't use what they can't find.",
	),
	{
		id: 'search-problem',
		label: 'search: problem',
		topic: 'search',
		step: 'problem',
		enter: 'wipe',
		notes:
			"MCP's default shape is: list every tool up front. Connect a few servers and your agent's context is full before you say hello. (Click) And more tools makes the model worse at picking the right one.",
		html: (() => {
			const tools =
				'github_create_issue github_list_prs github_merge_pr slack_post_message slack_list_channels linear_create_issue linear_update_issue gmail_send gmail_search calendar_create_event calendar_list_events notion_search notion_create_page stripe_list_charges stripe_refund figma_get_file sentry_list_issues vercel_deploy dns_update kv_put jira_create_ticket drive_upload drive_search airtable_list_records spotify_play twilio_send_sms discord_post hubspot_create_contact zoom_create_meeting asana_create_task trello_move_card dropbox_upload shopify_list_orders postgres_query redis_get s3_put_object youtube_search bluesky_post todoist_add_task'.split(
					' ',
				)
			return html`
				<h2 class="headline">Agents <em>drown in tools.</em></h2>
				<div id="sp-box" style="position:absolute;left:120px;right:120px;top:270px;height:600px;border:3px dashed var(--line-strong);border-radius:24px;padding:32px;display:flex;flex-wrap:wrap;align-content:flex-start;gap:12px;overflow:hidden">
					${tools
						.map(
							(t, i) =>
								`<span class="sp-tool ${i < 18 ? 'sp-a' : 'sp-b'}" style="font-family:ui-monospace,monospace;font-size:27px;padding:8px 16px;border-radius:10px;background:var(--surface);border:2px solid var(--line)">${t}()</span>`,
						)
						.join('')}
				</div>
				<div style="position:absolute;left:120px;right:120px;top:896px;display:flex;align-items:center;gap:24px">
					<span class="label" style="font-size:34px">context window</span>
					<div style="flex:1;height:20px;border-radius:10px;background:var(--surface);overflow:hidden">
						<div id="sp-meter" style="height:100%;width:100%;border-radius:10px;background:var(--danger);transform-origin:0 50%"></div>
					</div>
				</div>
				${wayfind('search', 'problem')}`
		})(),
		steps: [
			(H) => {
				H.fade('#sp-box', 0.1)
				H.fade('.sp-a', 0.3, { d: 0.25, stagger: 0.025 })
				H.fromTo('#sp-meter', 0.3, { scaleX: 0, background: 'var(--accent)' }, { scaleX: 0.35, duration: 0.6, ease: 'power2.out' })
			},
			(H) => {
				H.fade('.sp-b', 0.4, { d: 0.2, stagger: 0.02 })
				H.to('#sp-meter', 0.4, { scaleX: 0.94, background: 'var(--danger)', duration: 0.8, ease: 'power2.inOut' })
			},
		],
	},
	{
		id: 'search-solution',
		label: 'search: solution',
		topic: 'search',
		step: 'solution',
		notes:
			"Kody exposes one search tool. The agent describes the task in plain words. (Click) It types what it wants... (Click) and gets back a short ranked list: built-in capabilities, your own packages, guides. Plus the exact call shape, so the next step can just run it.",
		html: html`
			<h2 class="headline">One search finds <em>the right one.</em></h2>
			<div class="card" id="ss-box" style="left:120px;right:120px;top:300px;height:130px;display:flex;align-items:center;gap:28px;padding:0 44px">
				<svg class="icon" viewBox="0 0 24 24" style="width:56px;height:56px;color:var(--muted)"><circle cx="10.5" cy="10.5" r="6.5"/><path d="M15.5 15.5 21 21"/></svg>
				<span style="font-size:48px"><span class="typed" id="ss-q">email my team the weekly PR summary</span><span class="caret" style="color:var(--topic)"></span></span>
			</div>
			<div id="ss-results" style="position:absolute;left:120px;right:120px;top:470px;display:flex;flex-direction:column;gap:18px">
				${[
					['emailSend', 'capability · email', 'kody.emailSend({ to, subject, text })'],
					['@kentcdodds/pr-summary', 'your package', "import summarize from 'kody:@kentcdodds/pr-summary/summarize'"],
					['Email from packages', 'guide', 'guide:email'],
				]
					.map(
						([name, kind, call], i) => html`<div class="ss-row card" style="position:relative;display:flex;align-items:center;gap:32px;padding:26px 40px;${i === 0 ? 'outline:4px solid var(--topic);' : ''}">
							<span class="label" style="font-size:36px;width:60px;color:var(--muted)">${i + 1}</span>
							<div style="flex:1">
								<div style="display:flex;align-items:baseline;gap:22px"><span style="font-family:ui-monospace,monospace;font-size:40px;font-weight:600">${name}</span><span class="muted" style="font-size:30px">${kind}</span></div>
								${i === 0 ? `<div style="margin-top:8px;font-family:ui-monospace,monospace;font-size:30px;color:var(--muted)">${esc(call)}</div>` : ''}
							</div>
						</div>`,
					)
					.join('')}
			</div>
			${wayfind('search', 'solution')}`,
		steps: [
			(H) => {
				H.in('#ss-box', 0.1)
			},
			(H) => {
				H.type('#ss-q', 0.15, 36, { d: 0.9 })
			},
			(H) => {
				H.in('.ss-row', 0.2, { stagger: 0.12, y: 20 })
			},
		],
	},
	{
		id: 'search-hood',
		label: 'search: under the hood',
		topic: 'search',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'execute',
		notes:
			'Under the hood: the query is embedded with Workers AI, matched in Vectorize filtered to your user id, and hydrated from D1. (Click) The same index holds your packages, guides, MCP servers, and secret names. Never secret values.',
		html: html`
			<h2 class="headline">Search is <em>a vector index per person.</em></h2>
			${diagram(
				[
					{ id: 'sh-q', x: 120, y: 380, w: 300, label: 'Query', sub: 'plain words', plain: true },
					{ id: 'sh-ai', x: 506, y: 380, w: 380, label: 'Workers AI', sub: 'embed the query', cf: true },
					{ id: 'sh-vec', x: 972, y: 380, w: 380, label: 'Vectorize', sub: 'filter: your id', cf: true },
					{ id: 'sh-d1', x: 1438, y: 380, w: 362, label: 'D1', sub: 'details + call', cf: true },
				],
				[
					['sh-q', 'sh-ai'],
					['sh-ai', 'sh-vec'],
					['sh-vec', 'sh-d1'],
				],
				{ id: 'sh' },
			)}
			<div id="sh-also" style="position:absolute;left:120px;right:120px;top:680px;display:flex;flex-wrap:wrap;gap:18px;align-items:center">
				<span class="label muted" style="margin-right:12px">Also indexed</span>
				${['capabilities', 'packages', 'guides', 'MCP servers', 'secret names'].map((c) => `<span class="chip sh-chip">${c}</span>`).join('')}
			</div>
			${wayfind('search', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-search-hood .node', 0.1, { stagger: 0.12 })
				H.fade('#s-search-hood .wire-g', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.fade('#sh-also .label', 0.5)
				H.in('.sh-chip', 0.55, { stagger: 0.08, y: 16 })
			},
		],
	},

	// ============================================================ execute
	topicCard('execute', 'Second door: execute.'),
	{
		id: 'execute-problem',
		label: 'execute: problem',
		topic: 'execute',
		step: 'problem',
		enter: 'wipe',
		notes:
			'Classic tool calling is a round trip per step. The model calls a tool, the whole result comes back through the context, the model reads it and calls the next one. (Click) Four steps, four round trips, and every byte of every result goes through the model.',
		html: html`
			<h2 class="headline">Every step is <em>a round trip.</em></h2>
			<div class="chip" style="position:absolute;left:180px;top:300px;font-size:44px">Agent</div>
			<div class="chip" style="position:absolute;right:180px;top:300px;font-size:44px">Tools</div>
			<div style="position:absolute;left:300px;top:390px;width:4px;height:560px;background:var(--line)"></div>
			<div style="position:absolute;right:300px;top:390px;width:4px;height:560px;background:var(--line)"></div>
			${['listRepos()', 'listPullRequests()', 'getReviews()', 'emailSend()']
				.map(
					(c, i) => html`<div class="ep-trip ${i < 2 ? 'ep-a' : 'ep-b'}" style="position:absolute;left:302px;right:302px;top:${420 + i * 132}px;height:120px">
						<div style="position:absolute;left:0;right:0;top:34px;height:4px;background:var(--ink)"></div>
						<svg viewBox="0 0 20 20" style="position:absolute;right:-4px;top:26px;width:20px;height:20px"><path d="M0 0 L20 10 L0 20 Z" fill="var(--ink)"/></svg>
						<div style="position:absolute;left:0;right:0;top:-12px;text-align:center;font-family:ui-monospace,monospace;font-size:34px">${c}</div>
						<div style="position:absolute;left:0;right:0;top:86px;height:4px;background:repeating-linear-gradient(90deg,var(--line-strong) 0 14px,transparent 14px 26px)"></div>
						<svg viewBox="0 0 20 20" style="position:absolute;left:-4px;top:78px;width:20px;height:20px"><path d="M20 0 L0 10 L20 20 Z" fill="var(--line-strong)"/></svg>
					</div>`,
				)
				.join('')}
			${wayfind('execute', 'problem')}`,
		steps: [
			(H) => {
				H.in('#s-execute-problem .chip', 0.1, { stagger: 0.1 })
				H.in('.ep-a', 0.35, { stagger: 0.2, x: -60, y: 0 })
			},
			(H) => {
				H.in('.ep-b', 0.55, { stagger: 0.2, x: -60, y: 0 })
			},
		],
	},
	{
		id: 'execute-solution',
		label: 'execute: solution',
		topic: 'execute',
		step: 'solution',
		notes:
			"With execute, the agent writes one small module and Kody runs it. Loops, filters, error handling: all in code, where models are already great. (Click) Every kody dot call is a capability it found with search. One round trip, and only the answer comes back.",
		html: html`
			<h2 class="headline">Agents write code. <em>Kody runs it.</em></h2>
			${code(
				`
import { kody } from 'kody:runtime'

export default async function main() {
  const { messages } = ⟦await kody.emailMessageList({ direction: 'inbound' })⟧
  const text = messages.map((m) => m.subject).join('\\n')
  ⟦await kody.emailSend({ subject: 'Inbox digest', text })⟧
  return messages.length
}`,
				{ id: 'es-code', x: 120, y: 300, size: 34 },
			)}
			${wayfind('execute', 'solution')}`,
		steps: [
			(H) => {
				H.in('#es-code', 0.1)
				H.fromTo('#es-code .hl', 0, { backgroundColor: 'rgba(0,0,0,0)' }, { backgroundColor: 'rgba(0,0,0,0)', duration: 0.01 })
			},
			(H) => {
				H.to('#es-code .hl', 0.5, { backgroundColor: 'color-mix(in oklab, var(--topic) 26%, transparent)', duration: 0.5, stagger: 0.15 })
			},
		],
	},
	{
		id: 'execute-hood',
		label: 'execute: under the hood',
		topic: 'execute',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'mcp',
		notes:
			"Every execute call gets a brand-new isolate from a Worker Loader. Milliseconds to start, nothing shared with the last run or anyone else. kody:runtime is a binding into Kody's capabilities. (Click) And the isolate has no network of its own. Every fetch goes through Kody's gateway, which checks the host and fills in secrets.",
		html: html`
			<h2 class="headline">Every run gets <em>a fresh, sealed isolate.</em></h2>
			${diagram(
				[
					{ id: 'eh-code', x: 120, y: 340, w: 340, label: 'Agent code', sub: 'one ES module', plain: true },
					{ id: 'eh-loader', x: 580, y: 340, w: 450, label: 'Worker Loader', sub: 'new isolate in ms', cf: true },
					{ id: 'eh-rt', x: 1150, y: 340, w: 440, label: 'kody:runtime', sub: 'capabilities via RPC' },
					{ id: 'eh-gw', x: 580, y: 670, w: 450, label: 'Fetch gateway', sub: 'host check + secrets', cls: 'eh-b' },
					{ id: 'eh-net', x: 1150, y: 670, w: 440, label: 'The internet', sub: 'approved hosts only', plain: true, cls: 'eh-b' },
				],
				[
					['eh-code', 'eh-loader'],
					['eh-loader', 'eh-rt'],
					['eh-loader', 'eh-gw', { from: 'b', to: 't', cls: 'eh-b' }],
					['eh-gw', 'eh-net', { cls: 'eh-b' }],
				],
				{ id: 'eh' },
			)}
			${wayfind('execute', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-execute-hood .node:not(.eh-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-execute-hood .wire-g:not(.eh-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#s-execute-hood .node.eh-b', 0.5, { stagger: 0.12 })
				H.fade('#s-execute-hood .wire-g.eh-b', 0.6, { stagger: 0.12 })
			},
		],
	},

	// ============================================================ the doors: MCP, CLI, API
	topicCard('mcp', "Search and execute are the whole API surface. Three doors expose them: MCP, the CLI, and HTTP. MCP first, the one most of you already use."),
	{
		id: 'mcp-how',
		label: 'MCP: how it works',
		topic: 'mcp',
		enter: 'wipe',
		notes:
			"MCP is one URL with OAuth: kody.codes/mcp. One command finds the agents on your machine and wires each one up. Claude Code, Codex, Cursor, whatever you use, they all get search and execute. Or skip that: some agents have Kody in their plugin marketplace, so it's one click. (Click) And my favorite trick: an agent that's already connected over MCP can mint a one-shot code for the CLI. The CLI redeems it for a scoped token in your keychain. No login flow, no pasting tokens.",
		html: html`
			<h2 class="headline">One URL. <em>Every agent.</em></h2>
			${term(
				[
					'<span class="p">$</span> <span class="typed" id="mh-cmd">npx @kodycodes/cli install</span>',
					...['Claude Code', 'Codex', 'Cursor', 'VS Code', 'Zed'].map((a) => `<span class="mh-ok"><span class="ok">✓</span> ${a} <span class="dim">→ kody.codes/mcp</span></span>`),
				],
				{ id: 'mh-term', x: 120, y: 280, w: 860 },
			)}
			<div id="mh-plugin" style="position:absolute;left:120px;top:770px;width:860px;font-size:40px">Or just add the <strong>Kody plugin</strong> from your agent's marketplace.</div>
			<div id="mh-boot" style="position:absolute;left:1040px;top:280px;width:760px">
				<div class="label" style="font-size:42px;margin-bottom:24px">Already on MCP?</div>
				${[
					['Agent calls', 'cliCredentialBootstrap'],
					['Gets a one-shot code', 'kody_bc_…'],
					['CLI redeems it', 'kody auth bootstrap --code'],
					['Scoped token, in your keychain', 'kody_at_…'],
				]
					.map(
						([what, code]) =>
							`<div class="card mh-step" style="position:relative;margin-bottom:16px;padding:20px 28px"><div style="font-size:32px" class="muted">${what}</div><div style="font-family:ui-monospace,monospace;font-size:34px;font-weight:600;margin-top:4px">${code}</div></div>`,
					)
					.join('')}
			</div>
			${wayfind('mcp')}`,
		steps: [
			(H) => {
				H.in('#mh-term', 0.1)
				H.type('#mh-cmd', 0.5, 26, { d: 0.45 })
				H.fade('.mh-ok', 1.0, { d: 0.15, stagger: 0.12 })
				H.in('#mh-plugin', 1.7, { y: 16 })
			},
			(H) => {
				H.in('.mh-step', 0.1, { stagger: 0.15, x: 30, y: 0 })
			},
		],
	},

	// ---------- CLI: local execute
	topicCard('cli', "The CLI is the door most people haven't seen. It runs execute somewhere surprising: your own machine."),
	{
		id: 'cli-problem',
		label: 'CLI: problem',
		topic: 'cli',
		step: 'problem',
		enter: 'wipe',
		notes:
			"Execute runs in Kody's cloud sandbox, which is exactly what you want most of the time. (Click) But the sandbox can't see your laptop: local files, a dev server on localhost, the NAS on your home network.",
		html: html`
			<h2 class="headline">The cloud <em>can't reach your machine.</em></h2>
			<div class="card" id="clp-cloud" style="left:120px;top:330px;width:620px;padding:40px 44px">
				<div class="label" style="font-size:44px;display:flex;align-items:center;gap:16px">${cfLogo(44)}Kody's sandbox</div>
				<div class="muted" style="font-size:34px;margin-top:12px">execute runs here</div>
			</div>
			<div class="card" id="clp-local" style="left:1180px;top:290px;width:620px;padding:36px 44px">
				<div class="label" style="font-size:44px">Your machine</div>
				${['./expenses.csv', 'localhost:3000', '192.168.1.20 (NAS)']
					.map((t) => `<div class="clp-item" style="margin-top:18px;font-family:ui-monospace,monospace;font-size:34px">${t}</div>`)
					.join('')}
			</div>
			<div id="clp-x" style="position:absolute;left:800px;top:400px;width:320px;height:120px">
				<svg viewBox="0 0 320 120" style="width:320px;height:120px">
					<path d="M0 60 H320" stroke="var(--danger)" stroke-width="8" stroke-dasharray="18 16" fill="none"/>
					<circle cx="160" cy="60" r="44" fill="var(--bg)" stroke="var(--danger)" stroke-width="8"/>
					<path d="M140 40 L180 80 M180 40 L140 80" stroke="var(--danger)" stroke-width="10" stroke-linecap="round"/>
				</svg>
			</div>
			${wayfind('cli', 'problem')}`,
		steps: [
			(H) => {
				H.in('#clp-cloud', 0.1)
				H.in('#clp-local', 0.25)
			},
			(H) => {
				H.in('#clp-x', 0.1, { scale: 0.6, y: 0, d: 0.6 })
			},
		],
	},
	{
		id: 'cli-solution',
		label: 'CLI: solution',
		topic: 'cli',
		step: 'solution',
		notes:
			"So the CLI can run execute locally. Same module, same kody calls, same imports from your packages. (Click) It reads the CSV on your disk and still sends the email through Kody. Your CPU is free; only the Kody calls count.",
		html: html`
			<h2 class="headline">Same module. <em>Your machine.</em></h2>
			${term(
				[
					'<span class="p">$</span> <span class="typed" id="cls-cmd">kody execute --local --file ./expense-report.js</span>',
					' ',
					'<span class="cls-out"><span class="dim">workerd</span>  read ./expenses.csv  <span class="dim">(local)</span></span>',
					'<span class="cls-out"><span class="dim">kody   </span>  emailSend  <span class="dim">(via Kody)</span></span>',
					'<span class="cls-out"><span class="ok">✓</span> 42 receipts, $1,318.07</span>',
				],
				{ id: 'cls-term', x: 120, y: 290, w: 1680 },
			)}
			${wayfind('cli', 'solution')}`,
		steps: [
			(H) => {
				H.in('#cls-term', 0.1)
				H.type('#cls-cmd', 0.5, 46, { d: 0.6 })
			},
			(H) => {
				H.fade('.cls-out', 0.1, { d: 0.2, stagger: 0.3 })
			},
		],
	},
	{
		id: 'cli-hood',
		label: 'CLI: under the hood',
		topic: 'cli',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'api',
		notes:
			"Your module runs in workerd, the same open-source runtime as Workers, on your machine. Every kody:runtime call becomes a request to the CapabilityProxy at api.kody.codes, which dispatches through the exact same tool map as cloud execute. (Click) Imports from your packages are downloaded as a package graph and bundled into the local worker. And a fetch that carries a secret placeholder hops to Kody's fetch gateway, so secret values never enter your machine.",
		html: html`
			<h2 class="headline">Local workerd, <em>cloud capabilities.</em></h2>
			<div id="clh-box" style="position:absolute;left:96px;top:300px;width:900px;height:520px;border:3px dashed var(--line-strong);border-radius:28px"></div>
			<div class="label muted" id="clh-box-label" style="position:absolute;left:130px;top:262px;padding:0 14px;background:var(--bg);font-size:32px">your machine</div>
			${diagram(
				[
					{ id: 'clh-mod', x: 140, y: 360, w: 320, label: 'Your module', sub: 'expense-report.js', plain: true },
					{ id: 'clh-wd', x: 560, y: 360, w: 400, label: 'workerd', sub: 'kody:runtime shim', cf: true },
					{ id: 'clh-cp', x: 1080, y: 360, w: 460, label: 'CapabilityProxy', sub: 'api.kody.codes', cf: true },
					{ id: 'clh-kody', x: 1600, y: 360, w: 220, label: 'kody.*', sub: 'same tools' },
					{ id: 'clh-pg', x: 560, y: 660, w: 400, label: 'Package graph', sub: 'your package imports', cls: 'clh-b' },
					{ id: 'clh-gw', x: 1080, y: 660, w: 460, label: 'Fetch gateway', sub: 'secrets stay in the cloud', cls: 'clh-b' },
				],
				[
					['clh-mod', 'clh-wd'],
					['clh-wd', 'clh-cp'],
					['clh-cp', 'clh-kody'],
					['clh-pg', 'clh-wd', { from: 't', to: 'b', cls: 'clh-b' }],
					['clh-wd', 'clh-gw', { from: 'b', to: 'l', cls: 'clh-b' }],
				],
				{ id: 'clh' },
			)}
			${wayfind('cli', 'hood')}`,
		steps: [
			(H) => {
				H.fade(['#clh-box', '#clh-box-label'], 0.05)
				H.in('#s-cli-hood .node:not(.clh-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-cli-hood .wire-g:not(.clh-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#s-cli-hood .node.clh-b', 0.1, { stagger: 0.15 })
				H.fade('#s-cli-hood .wire-g.clh-b', 0.2, { stagger: 0.15 })
			},
		],
	},

	// ---------- API
	topicCard('api', 'And the third door: plain HTTP.'),
	{
		id: 'api-how',
		label: 'API: how it works',
		topic: 'api',
		enter: 'wipe',
				exit: 'wipe',
		nextTopic: 'memory',
		notes:
			"The third door is a plain HTTP API, for anything that isn't an agent: scripts, CI, other apps. api.kody.codes is its own small Worker at the edge: CORS, rate limits, a body cap. It hands off to Kody over a service binding, no public hop, with a scoped token. (Click) Same search, same execute, same isolation, same audit trail, whatever the client.",
		html: html`
			<h2 class="headline">Same capabilities, <em>any client.</em></h2>
			${diagram(
				[
					{ id: 'ch-t', x: 120, y: 380, w: 290, label: 'Any client', sub: 'scoped token', plain: true },
					{ id: 'ch-api', x: 493, y: 380, w: 440, label: 'api.kody.codes', sub: 'edge Worker', cf: true },
					{ id: 'ch-sb', x: 1016, y: 380, w: 450, label: 'Service binding', sub: 'no public hop', cf: true },
					{ id: 'ch-k', x: 1549, y: 380, w: 251, label: 'Kody', sub: 'same tools' },
				],
				[
					['ch-t', 'ch-api'],
					['ch-api', 'ch-sb'],
					['ch-sb', 'ch-k'],
				],
				{ id: 'chd' },
			)}
			<div id="ch-clients" style="position:absolute;left:120px;right:120px;top:680px;display:flex;gap:18px;align-items:center;flex-wrap:wrap">
				<span class="label muted" style="margin-right:12px">Same door for</span>
				${['scripts', 'CI', 'other apps', 'the CLI'].map((c) => `<span class="chip ch-c">${c}</span>`).join('')}
			</div>
			${wayfind('api')}`,
		steps: [
			(H) => {
				H.in('#s-api-how .node', 0.1, { stagger: 0.12 })
				H.fade('#s-api-how .wire-g', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.fade('#ch-clients .label', 0.5)
				H.in('.ch-c', 0.55, { stagger: 0.08, y: 16 })
			},
		],
	},

	// ============================================================ memory
	topicCard('memory', "Now what's in your room. Memory first."),
	{
		id: 'memory-problem',
		label: 'memory: problem',
		topic: 'memory',
		step: 'problem',
		enter: 'wipe',
		notes:
			"Every agent keeps its own memory, and none of them can see the others'. So every new agent asks the same questions. What time zone are you in? (Click) And you answer them. Again.",
		html: html`
			<h2 class="headline">Every agent <em>starts from zero.</em></h2>
			${['claude', 'codex', 'grok']
				.map(
					(a, i) => html`<div style="position:absolute;left:${120 + i * 580}px;top:320px;width:520px">
						<div class="mp-q" style="display:flex;gap:20px;align-items:flex-start">
							${agent('mem', i, 64)}
							<div class="bubble" style="position:relative;white-space:nowrap;font-size:36px">What's your time zone?</div>
						</div>
						<div class="mp-a" style="display:flex;justify-content:flex-end;margin-top:36px">
							<div class="bubble me" style="position:relative">Mountain Time.${i === 2 ? ' Again.' : ''}</div>
						</div>
					</div>`,
				)
				.join('')}
			${wayfind('memory', 'problem')}`,
		steps: [
			(H) => {
				H.in('.mp-q', 0.1, { stagger: 0.15 })
			},
			(H) => {
				H.in('.mp-a', 0.5, { stagger: 0.15, y: 16 })
			},
		],
	},
	{
		id: 'memory-solution',
		label: 'memory: solution',
		topic: 'memory',
		step: 'solution',
		notes:
			"In Kody, memory belongs to you, not to the agent. Tell one agent you're on Mountain Time, once. (Click) Every agent connected as you gets it, surfaced automatically when it's relevant.",
		html: html`
			<h2 class="headline">Tell one agent. <em>Every agent knows.</em></h2>
			<div class="card" id="ms-card" style="left:120px;top:420px;width:760px;padding:40px 44px;display:flex;gap:30px;align-items:center">
				${orb('memory', 120)}
				<div class="body" style="font-size:42px;white-space:nowrap">Kent is on Mountain Time.</div>
			</div>
			<svg class="wires" viewBox="0 0 1920 1080">
				${[300, 540, 780]
					.map(
						(y, i) =>
							`<g class="wire-g ms-w"><path class="wire" d="M900 530 C1100 530 1100 ${y + 40} 1300 ${y + 40}"/><path class="wire-head" d="M0 0 L-18 -11 L-18 11 Z" transform="translate(1316 ${y + 40})"/></g>`,
					)
					.join('')}
			</svg>
			${['claude', 'codex', 'grok']
				.map(
					(a, i) =>
						`<div class="chip ms-agent" style="position:absolute;left:1330px;top:${292 + i * 240}px;padding:18px">${agent('mem', i, 72)}</div>`,
				)
				.join('')}
			${wayfind('memory', 'solution')}`,
		steps: [
			(H) => {
				H.in('#ms-card', 0.1)
			},
			(H) => {
				H.fade('.ms-w', 0.4, { stagger: 0.12 })
				H.in('.ms-agent', 0.5, { stagger: 0.12, x: 30, y: 0 })
			},
		],
	},
	{
		id: 'memory-hood',
		label: 'memory: under the hood',
		topic: 'memory',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'packages',
		notes:
			"Agents send a short memoryContext with normal search and execute calls: what they're working on. Kody matches it against your memories in Vectorize and inlines the best few. The memory itself lives in D1, scoped to you. (Click) Writes are verify-first: search for a related memory before saving a new one, so memory stays small and true.",
		html: html`
			<h2 class="headline">Memories ride along <em>on every call.</em></h2>
			${diagram(
				[
					{ id: 'mh-ctx', x: 120, y: 380, w: 380, label: 'memoryContext', sub: 'sent with calls', plain: true },
					{ id: 'mh-vec', x: 587, y: 380, w: 380, label: 'Vectorize', sub: 'your memories', cf: true },
					{ id: 'mh-d1', x: 1054, y: 380, w: 330, label: 'D1', sub: 'the memory', cf: true },
					{ id: 'mh-out', x: 1471, y: 380, w: 329, label: 'Agent', sub: 'best matches', plain: true },
				],
				[
					['mh-ctx', 'mh-vec'],
					['mh-vec', 'mh-d1'],
					['mh-d1', 'mh-out'],
				],
				{ id: 'mh' },
			)}
			<div class="card" id="mh-rule" style="left:120px;top:680px;padding:30px 40px;display:flex;gap:24px;align-items:center;font-size:42px">
				<span class="label" style="font-size:42px;color:color-mix(in oklab,var(--topic) 70%,var(--ink))">Verify first.</span>
				<span>Search before you save.</span>
			</div>
			${wayfind('memory', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-memory-hood .node', 0.1, { stagger: 0.12 })
				H.fade('#s-memory-hood .wire-g', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#mh-rule', 0.5)
			},
		],
	},

	// ============================================================ packages
	topicCard('packages', 'Packages.'),
	{
		id: 'packages-problem',
		label: 'packages: problem',
		topic: 'packages',
		step: 'problem',
		enter: 'wipe',
		notes:
			'Your agent writes genuinely useful code all day long. (Click) Then the chat ends, and the code is gone. Next week you ask for the same thing and get a slightly different version.',
		html: html`
			<h2 class="headline">The code your agent writes <em>disappears.</em></h2>
			<div class="bubble me" id="pp-ask" style="right:120px;top:300px">Summarize my open PRs every Monday.</div>
			<div id="pp-code-wrap" style="position:absolute;left:120px;top:440px;width:1280px">
				${code(
					`
export default async function prSummary() {
  const prs = await github.pulls.list({ state: 'open' })
  const stale = prs.filter((pr) => daysOld(pr) > 7)
  return formatSummary(prs, stale)
}`,
					{ id: 'pp-code', x: 0, y: 0, size: 36 },
				)}
			</div>
			${wayfind('packages', 'problem')}`,
		steps: [
			(H) => {
				H.in('#pp-ask', 0.1)
				H.in('#pp-code-wrap', 0.3)
			},
			(H) => {
				H.to('#pp-code-wrap', 0.4, { opacity: 0.22, filter: 'blur(9px)', y: -30, duration: 0.9, ease: 'power2.in' })
			},
		],
	},
	{
		id: 'packages-solution',
		label: 'packages: solution',
		topic: 'packages',
		step: 'solution',
		notes:
			"In Kody, that code becomes a package. A real Git repo with history, owned by you. Your own GitHub. (Click) And any code can import it by name, from execute, from another package, from an app. Your own npm.",
		html: html`
			<h2 class="headline">Save it. Version it. <em>Import it.</em></h2>
			<div class="card" id="pk-repo" style="left:120px;top:300px;width:700px;padding:40px 44px">
				<div style="display:flex;align-items:center;gap:24px">${orb('packages', 84)}<span style="font-family:ui-monospace,monospace;font-size:38px;font-weight:600">@kentcdodds/pr-summary</span></div>
				<div style="margin-top:32px;display:flex;flex-direction:column;gap:22px;font-size:36px">
					${[
						['a3f9e1', 'Skip draft PRs'],
						['7c02bd', 'Group by repo'],
						['e41a7f', 'First version'],
					]
						.map(
							([sha, msg]) =>
								`<div style="display:flex;gap:22px;align-items:center"><span style="width:18px;height:18px;border-radius:50%;border:4px solid var(--topic);flex:none"></span><span style="font-family:ui-monospace,monospace;color:var(--muted)">${sha}</span><span>${msg}</span></div>`,
						)
						.join('')}
				</div>
			</div>
			<div id="pk-import-wrap" style="position:absolute;left:860px;top:300px">
				${code(
					`
import summarize from
  ⟦'kody:@kentcdodds/pr-summary/summarize'⟧

await summarize({ repo: 'kody' })`,
					{ id: 'pk-import', x: 0, y: 0, size: 32 },
				)}
			</div>
			${wayfind('packages', 'solution')}`,
		steps: [
			(H) => {
				H.in('#pk-repo', 0.1)
			},
			(H) => {
				H.in('#pk-import-wrap', 0.4, { x: 40, y: 0 })
			},
		],
	},
	{
		id: 'packages-hood',
		label: 'packages: under the hood',
		topic: 'packages',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'triggers',
		notes:
			"Every package is a Git repo on Cloudflare Artifacts. Agents edit in a repo session, a Durable Object holding a working copy. Publish runs checks: types, exports, imports. (Click) What ships is a bundle snapshot in KV, which a Worker Loader runs on demand. Static imports between packages are resolved at publish, so calling another package costs nothing extra.",
		html: html`
			<h2 class="headline">Every package is <em>a Git repo.</em></h2>
			${diagram(
				[
					{ id: 'ph-s', x: 120, y: 340, w: 420, label: 'Repo session', sub: 'Durable Object', cf: true },
					{ id: 'ph-a', x: 640, y: 340, w: 420, label: 'Artifacts', sub: 'Git repo per package', cf: true },
					{ id: 'ph-c', x: 1160, y: 340, w: 420, label: 'Publish checks', sub: 'types · exports' },
					{ id: 'ph-kv', x: 1160, y: 670, w: 420, label: 'KV', sub: 'bundle snapshot', cf: true, cls: 'ph-b' },
					{ id: 'ph-l', x: 640, y: 670, w: 420, label: 'Worker Loader', sub: 'runs it on demand', cf: true, cls: 'ph-b' },
				],
				[
					['ph-s', 'ph-a'],
					['ph-a', 'ph-c'],
					['ph-c', 'ph-kv', { from: 'b', to: 't', cls: 'ph-b' }],
					['ph-kv', 'ph-l', { from: 'l', to: 'r', cls: 'ph-b' }],
				],
				{ id: 'ph' },
			)}
			${wayfind('packages', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-packages-hood .node:not(.ph-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-packages-hood .wire-g:not(.ph-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#s-packages-hood .node.ph-b', 0.5, { stagger: 0.15 })
				H.fade('#s-packages-hood .wire-g.ph-b', 0.6, { stagger: 0.15 })
			},
		],
	},

	// ============================================================ triggers
	topicCard('triggers', 'Triggers.'),
	{
		id: 'triggers-problem',
		label: 'triggers: problem',
		topic: 'triggers',
		step: 'problem',
		enter: 'wipe',
		notes:
			"Agents can wake up on a schedule now, and that's great. But every run hands the task back to a model, which reinterprets it from scratch. (Click) Same cron, three Mondays, three different answers. You pay for the model every run, and the schedule lives in that one agent's house.",
		html: html`
			<h2 class="headline">Scheduled agents <em>improvise every run.</em></h2>
			${[
				'5 open PRs. 2 need your review.',
				"Here's an overview of your repos this week…",
				"I couldn't find any PRs. Should I check GitHub?",
			]
				.map(
					(out, i) => html`<div class="card tp-run ${i === 0 ? 'tp-a' : 'tp-b'}" style="left:${120 + i * 573}px;top:290px;width:534px;padding:30px 34px">
						<div style="display:flex;align-items:center;gap:16px">
							${agent('cron', 0, 48)}
							<span class="label" style="font-size:36px">Mon 9:00</span>
							<span class="muted" style="margin-left:auto;font-size:28px">run ${i + 1}</span>
						</div>
						<div style="margin-top:22px;font-size:38px;line-height:1.3;min-height:150px">${out}</div>
						<div style="margin-top:18px"><span class="chip" style="font-size:28px;padding:8px 20px;border-color:var(--danger);color:var(--danger)">model call</span></div>
					</div>`,
				)
				.join('')}
			<div id="tp-costs" style="position:absolute;left:120px;top:770px;display:flex;gap:20px;align-items:center">
				${['different every run', 'paid every run', 'stuck in one agent'].map((c) => `<span class="chip tp-c" style="border-color:var(--danger)">${c}</span>`).join('')}
			</div>
			${wayfind('triggers', 'problem')}`,
		steps: [
			(H) => {
				H.in('.tp-a', 0.1)
			},
			(H) => {
				H.in('.tp-b', 0.3, { stagger: 0.15 })
				H.in('.tp-c', 0.7, { stagger: 0.08, y: 16 })
			},
		],
	},
	{
		id: 'triggers-solution',
		label: 'triggers: solution',
		topic: 'triggers',
		step: 'solution',
		notes:
			"In Kody, the agent writes the code once, and a trigger runs that same code every time. A cron schedule. A webhook URL. An email address that's really yours. Events from inside Kody. (Click) Each one runs your package, as you, with no model in the loop unless you put one there.",
		html: html`
			<h2 class="headline">Run deterministic code <em>on a trigger.</em></h2>
			${[
				['cron', '0 9 * * MON'],
				['webhook', 'POST /@kent/webhooks/stripe'],
				['email', 'kent@inbox.kody.codes'],
				['event', 'email.message.received'],
			]
				.map(
					([k, v], i) =>
						`<div class="card ts-trig" style="left:120px;top:${290 + i * 150}px;width:880px;padding:26px 36px;display:flex;align-items:baseline;gap:28px"><span class="label" style="width:170px">${k}</span><span style="font-family:ui-monospace,monospace;font-size:34px">${v}</span></div>`,
				)
				.join('')}
			<svg class="wires" viewBox="0 0 1920 1080">
				${[0, 1, 2, 3]
					.map(
						(i) =>
							`<g class="wire-g ts-w"><path class="wire" d="M1010 ${340 + i * 150} C1150 ${340 + i * 150} 1150 560 1290 560"/><path class="wire-head" d="M0 0 L-18 -11 L-18 11 Z" transform="translate(1306 560)"/></g>`,
					)
					.join('')}
			</svg>
			<div class="card" id="ts-pkg" style="left:1320px;top:470px;width:480px;padding:34px 36px;display:flex;align-items:center;gap:24px">
				${orb('packages', 96)}
				<span style="font-family:ui-monospace,monospace;font-size:34px;font-weight:600">@you/<br />priority-queue</span>
			</div>
			${wayfind('triggers', 'solution')}`,
		steps: [
			(H) => {
				H.in('.ts-trig', 0.1, { stagger: 0.1, x: -30, y: 0 })
			},
			(H) => {
				H.fade('.ts-w', 0.4, { stagger: 0.08 })
				H.in('#ts-pkg', 0.5, { scale: 0.85, y: 0 })
			},
		],
	},
	{
		id: 'triggers-hood',
		label: 'triggers: under the hood',
		topic: 'triggers',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'credentials',
		notes:
			"Schedules live in a JobManager Durable Object, using alarms to wake up exactly when the next job is due. Long jobs hand off to Workflows: durable steps that retry and survive restarts. (Click) Mail comes in through Email Routing into a Mailbox Durable Object per inbox, with the raw message in R2. Events fan out to your package subscriptions.",
		html: html`
			<h2 class="headline">Durable Objects <em>keep the clock.</em></h2>
			${diagram(
				[
					{ id: 'th-jm', x: 120, y: 330, w: 450, label: 'JobManager', sub: 'Durable Object alarms', cf: true },
					{ id: 'th-wf', x: 680, y: 330, w: 450, label: 'Workflows', sub: 'durable, retried steps', cf: true },
					{ id: 'th-pkg', x: 1380, y: 495, w: 420, label: 'Your package', sub: 'runs as you', plain: true },
					{ id: 'th-er', x: 120, y: 660, w: 450, label: 'Email Routing', sub: 'your inbox address', cf: true, cls: 'th-b' },
					{ id: 'th-mb', x: 680, y: 660, w: 450, label: 'Mailbox', sub: 'Durable Object + R2', cf: true, cls: 'th-b' },
				],
				[
					['th-jm', 'th-wf'],
					['th-wf', 'th-pkg'],
					['th-er', 'th-mb', { cls: 'th-b' }],
					['th-mb', 'th-pkg', { cls: 'th-b' }],
				],
				{ id: 'th' },
			)}
			${wayfind('triggers', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-triggers-hood .node:not(.th-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-triggers-hood .wire-g:not(.th-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#s-triggers-hood .node.th-b', 0.5, { stagger: 0.12 })
				H.fade('#s-triggers-hood .wire-g.th-b', 0.6, { stagger: 0.12 })
			},
		],
	},

	// ============================================================ credentials
	topicCard('credentials', 'Credentials.'),
	{
		id: 'credentials-problem',
		label: 'credentials: problem',
		topic: 'credentials',
		step: 'problem',
		enter: 'wipe',
		notes:
			"How do most of us give an agent access to an API today? We paste the key into the chat. (Click) Now it lives in the transcript, the model's context, maybe logs, forever. (Click) And if you're thinking 'I'd never do that'... your .env file is even worse. Every agent on your machine can read it, and it has all your keys, not just one.",
		html: html`
			<h2 class="headline">Pasting API keys <em>into chat.</em></h2>
			<div class="bubble me" id="crp-msg" style="left:120px;top:320px;max-width:1300px;font-size:48px">
				Here's my Stripe key:
				<span id="crp-key" style="font-family:ui-monospace,monospace;padding:2px 12px;border-radius:10px;background:color-mix(in oklab,var(--danger) 18%,transparent);color:var(--danger)">sk_live_51Hx9a2Lq…</span>
			</div>
			<div id="crp-where" style="position:absolute;left:120px;top:560px;display:flex;gap:24px;align-items:center">
				<span class="label muted" style="margin-right:12px">Now it lives in</span>
				${['the transcript', 'model context', 'logs', 'forever'].map((c) => `<span class="chip crp-c" style="border-color:var(--danger)">${c}</span>`).join('')}
			</div>
			<div id="crp-env" style="position:absolute;left:120px;top:690px;display:flex;align-items:center;gap:56px">
				<div class="label" style="font-size:60px;letter-spacing:-0.02em">And your <span style="font-family:ui-monospace,monospace;font-weight:600">.env</span>? <span style="color:var(--danger)">Even worse.</span></div>
				<div class="card" id="crp-envfile" style="position:relative;padding:0;overflow:hidden;border:2px solid color-mix(in oklab,var(--danger) 45%,var(--line));transform:rotate(-1.5deg)">
					<div style="padding:12px 26px;background:var(--surface-2);font-family:ui-monospace,monospace;font-size:28px;color:var(--muted)">.env</div>
					<div style="padding:18px 26px 22px;font-family:ui-monospace,monospace;font-size:30px;line-height:1.55;white-space:pre">STRIPE_SECRET_KEY=<span style="color:var(--danger)">sk_live_51Hx…</span>
OPENAI_API_KEY=<span style="color:var(--danger)">sk-proj-8f2…</span>
GITHUB_TOKEN=<span style="color:var(--danger)">ghp_Zq41…</span></div>
				</div>
			</div>
			${wayfind('credentials', 'problem')}`,
		steps: [
			(H) => {
				H.in('#crp-msg', 0.1)
			},
			(H) => {
				H.fade('#crp-where .label', 0.4)
				H.in('.crp-c', 0.45, { stagger: 0.1, y: 16 })
			},
			(H) => {
				H.in('#crp-env .label', 0.35, { y: 24 })
				H.in('#crp-envfile', 0.5, { scale: 0.8, y: 30, d: 0.7 })
			},
		],
	},
	{
		id: 'credentials-solution',
		label: 'credentials: solution',
		topic: 'credentials',
		step: 'solution',
		notes:
			"In Kody, you save the secret once, through a page the agent never sees. Code refers to it by name. (Click) The value is filled in on the way out the door, only for hosts you approved. The agent uses your keys without ever holding them.",
		html: html`
			<h2 class="headline">Agents use secrets <em>they never see.</em></h2>
			${code(
				`
await fetch('https://api.stripe.com/v1/charges', {
  headers: {
    Authorization: ⟦'Bearer ⟪secret:stripe⟫'⟧,
  },
})`,
				{ id: 'cs-code', x: 120, y: 300, size: 34 },
			)}
			<div id="crs-kody" style="position:absolute;left:1320px;top:250px;width:560px;height:560px">
				<img class="amb-sway" src="assets/img/kody-keys.webp" alt="Kody holding keys" style="width:100%;height:100%" />
			</div>
			${wayfind('credentials', 'solution')}`,
		steps: [
			(H) => {
				H.in('#cs-code', 0.1)
				H.fromTo('#cs-code .hl', 0, { backgroundColor: 'rgba(0,0,0,0)' }, { backgroundColor: 'rgba(0,0,0,0)', duration: 0.01 })
			},
			(H) => {
				H.to('#cs-code .hl', 0.4, { backgroundColor: 'color-mix(in oklab, var(--topic) 28%, transparent)', duration: 0.5 })
				H.in('#crs-kody', 0.45, { y: 50, scale: 0.92 })
			},
		],
	},
	{
		id: 'credentials-hood',
		label: 'credentials: under the hood',
		topic: 'credentials',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'apps',
		notes:
			"The isolate only ever sees the placeholder. Its outbound fetch is routed to Kody's fetch gateway, which checks the host against the secret's allowlist, decrypts the value, and swaps it in. (Click) Send the same placeholder anywhere else, and the request is refused before it leaves.",
		html: html`
			<h2 class="headline">Swapped at the edge, <em>for approved hosts only.</em></h2>
			${diagram(
				[
					{ id: 'kh-iso', x: 120, y: 420, w: 400, label: 'Isolate', sub: 'sees &#123;&#123;secret&#58;stripe&#125;&#125;', plain: true },
					{ id: 'kh-gw', x: 640, y: 420, w: 450, label: 'Fetch gateway', sub: 'host allowed?' },
					{ id: 'kh-ok', x: 1260, y: 300, w: 440, label: 'api.stripe.com', sub: 'gets the real key', plain: true },
					{ id: 'kh-d1', x: 640, y: 720, w: 450, label: 'D1', sub: 'encrypted value', cf: true },
					{ id: 'kh-no', x: 1260, y: 560, w: 440, label: 'evil.example', sub: 'refused', plain: true, cls: 'kh-b' },
				],
				[
					['kh-iso', 'kh-gw'],
					['kh-gw', 'kh-ok'],
					['kh-d1', 'kh-gw', { from: 't', to: 'b' }],
					['kh-gw', 'kh-no', { cls: 'kh-b kh-bad' }],
				],
				{ id: 'kh' },
			)}
			<style>
				#kh-no { border-color: var(--danger); }
				#kh-no .label { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 3px; }
				.kh-bad .wire { stroke: var(--danger); }
				.kh-bad .wire-head { fill: var(--danger); }
			</style>
			${wayfind('credentials', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-credentials-hood .node:not(.kh-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-credentials-hood .wire-g:not(.kh-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#kh-no', 0.5, { x: 30, y: 0 })
				H.fade('#s-credentials-hood .wire-g.kh-b', 0.5)
			},
		],
	},

	// ============================================================ apps
	topicCard('apps', 'Apps.'),
	{
		id: 'apps-problem',
		label: 'apps: problem',
		topic: 'apps',
		step: 'problem',
		enter: 'wipe',
		notes:
			"Chat is great for asking. It's a terrible control center. You can read the state, sort of, as a wall of JSON. (Click) And acting on it means typing commands back and hoping you picked the right one. Some work wants a UI you can come back to, see at a glance, and click.",
		html: html`
			<h2 class="headline">Chat is <em>a bad control center.</em></h2>
			<div class="bubble" id="ap-dump" style="left:120px;top:280px;width:1680px;max-width:none;height:560px;overflow:hidden;font-family:ui-monospace,monospace;font-size:30px;line-height:1.45;color:var(--muted);-webkit-mask-image:linear-gradient(#000 50%,transparent);mask-image:linear-gradient(#000 50%,transparent)">${esc(
				'[{"repo":"kody","number":4132,"title":"fix post-merge review findings","author":"kentcdodds","state":"open","reviews":[{"user":"…","state":"APPROVED"}],"checks":{"total":14,"passing":13,"failing":1},"updated_at":"2026-10-20T18:22:09Z","labels":["bug","p2"]},{"repo":"kody","number":4131,"title":"show expired package Keys as Expired","author":"kentcdodds","state":"open","reviews":[],"checks":{"total":14,"passing":14,"failing":0},"updated_at":"2026-10-20T15:02:44Z","labels":["ui"]},{"repo":"kody","number":4130,"title":"drop leftover pins and extra cases","author":"kentcdodds","state":"open","reviews":[{"user":"…","state":"CHANGES_REQUESTED"}],"checks":{"total":14,"passing":12,"failing":2},"updated_at":"2026-10-19T22:41:10Z","labels":["test"]},{"repo":"kody","number":4128,"title":"describe credential lists and package-app paths","author":"kentcdodds","state":"open","reviews":[],"checks":{"total":9,"passing":9,"failing":0}}]',
			)}</div>
			<div class="bubble me" id="ap-ask" data-layout-allow-overlap style="right:120px;top:770px;font-size:44px">Merge #4131. Wait, which one passed?</div>
			${wayfind('apps', 'problem')}`,
		steps: [
			(H) => {
				H.in('#ap-dump', 0.1)
			},
			(H) => {
				H.in('#ap-ask', 0.4, { y: 24 })
			},
		],
	},
	{
		id: 'apps-solution',
		label: 'apps: solution',
		topic: 'apps',
		step: 'solution',
		notes:
			"So packages can ship apps. Not just a dashboard: a control center. See every PR at a glance. (Click) And act: merge the green one, turn on auto-merge. Every button calls your package's code, as you. (Click) It lives at your own subdomain on kody.run, or on your own domain, and you can share it with your team like anything else in Kody.",
		html: html`
			<h2 class="headline">Packages ship <em>control centers.</em></h2>
			<div class="card" id="as-win" style="left:120px;top:270px;width:1680px;height:660px;overflow:hidden;border:2px solid var(--line)">
				<div style="display:flex;align-items:center;gap:20px;padding:20px 28px;background:var(--surface-2);border-bottom:2px solid var(--line)">
					<span style="display:flex;gap:10px"><i style="width:16px;height:16px;border-radius:50%;background:var(--line-strong)"></i><i style="width:16px;height:16px;border-radius:50%;background:var(--line-strong)"></i><i style="width:16px;height:16px;border-radius:50%;background:var(--line-strong)"></i></span>
					<span style="flex:1;padding:8px 24px;border-radius:999px;background:var(--surface);font-size:32px;display:grid">
						<span class="as-url-a" style="grid-area:1/1"><span class="muted">https://</span>kent.kody.run<span class="muted">/pr-control</span></span>
						<span class="as-url-b" style="grid-area:1/1"><span class="muted">https://</span>prs.kentcdodds.com</span>
					</span>
				</div>
				<div style="display:flex;gap:40px;padding:32px 40px">
					<div style="flex:1">
						<div class="label" style="font-size:44px">Pull requests</div>
						<div style="margin-top:22px;display:flex;flex-direction:column;gap:14px">
							${[
								['#4132', 'fix post-merge review findings', 'var(--danger)', '1 failing', 'Re-run', ''],
								['#4131', 'show expired Keys as Expired', 'var(--accent)', 'ready', 'Merge', 'as-merge'],
								['#4130', 'drop leftover pins', 'var(--danger)', 'changes', 'Ping', ''],
								['#4128', 'describe credential lists', 'var(--accent)', 'ready', 'Merge', ''],
							]
								.map(
									([n, t, c, st, action, cls]) => html`<div class="as-row ${cls}" style="display:flex;align-items:center;gap:22px;padding:14px 16px 14px 24px;border-radius:14px;background:var(--surface-2);font-size:32px">
										<span class="muted" style="font-family:ui-monospace,monospace;width:100px">${n}</span>
										<span style="flex:1;white-space:nowrap">${t}</span>
										<span style="display:grid;width:170px;font-size:28px">
											<span class="as-st-a" style="grid-area:1/1;display:flex;align-items:center;gap:12px"><i style="width:14px;height:14px;border-radius:50%;background:${c}"></i>${st}</span>
											${cls ? `<span class="as-st-b" style="grid-area:1/1;display:flex;align-items:center;gap:12px;color:var(--topic)"><i style="width:14px;height:14px;border-radius:50%;background:var(--topic)"></i>merged</span>` : ''}
										</span>
										<span class="as-btn" style="position:relative;display:grid;width:150px">
											<span class="as-btn-a" style="grid-area:1/1;text-align:center;padding:10px 0;border-radius:12px;background:var(--surface);border:2px solid var(--line);font-family:'Bricolage Grotesque',system-ui,sans-serif;font-weight:700;font-size:28px">${action}</span>
											${cls ? `<span class="as-btn-b" style="grid-area:1/1;text-align:center;padding:10px 0;border-radius:12px;background:var(--topic);color:#fff;font-family:'Bricolage Grotesque',system-ui,sans-serif;font-weight:700;font-size:28px">Merged ✓</span>${cursor('as-cur-1')}` : ''}
										</span>
									</div>`,
								)
								.join('')}
						</div>
					</div>
					<div style="width:440px;padding-left:40px;border-left:2px solid var(--line)">
						<div class="label" style="font-size:44px">Automations</div>
						<div style="margin-top:22px;display:flex;flex-direction:column;gap:26px;font-size:32px">
							${[
								['Monday summary', true, ''],
								['Auto-merge green', false, 'as-toggle'],
								['Nudge stale reviews', true, ''],
							]
								.map(
									([label, on, cls]) => html`<div style="display:flex;align-items:center;justify-content:space-between;gap:20px">
										<span>${label}</span>
										<span class="${cls}" style="position:relative;flex:none;width:76px;height:42px;border-radius:21px;background:${on ? 'var(--topic)' : 'var(--line)'}">
											<i class="as-knob" style="position:absolute;top:5px;left:${on ? 39 : 5}px;width:32px;height:32px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.25)"></i>
											${cls ? cursor('as-cur-2') : ''}
										</span>
									</div>`,
								)
								.join('')}
						</div>
					</div>
				</div>
			</div>
			${wayfind('apps', 'solution')}`,
		steps: [
			(H) => {
				H.in('#as-win', 0.1)
				H.fromTo(['#s-apps-solution .as-st-b', '#s-apps-solution .as-btn-b', '.as-url-b', '#as-cur-1', '#as-cur-2'], 0, { opacity: 0 }, { opacity: 0, duration: 0.01 })
			},
			(H) => {
				// merge the green PR
				H.fromTo('#as-cur-1', 0.15, { opacity: 0, x: 40, y: 40 }, { opacity: 1, x: 0, y: 0, duration: 0.45, ease: 'power3.out' })
				H.fromTo('.as-merge .as-btn', 0.65, { scale: 1 }, { scale: 0.9, duration: 0.1, yoyo: true, repeat: 1, ease: 'power1.inOut' })
				H.to('.as-merge .as-btn-b', 0.75, { opacity: 1, duration: 0.25 })
				H.to('.as-merge .as-st-a', 0.75, { opacity: 0, duration: 0.2 })
				H.to('.as-merge .as-st-b', 0.8, { opacity: 1, duration: 0.25 })
				H.to('#as-cur-1', 0.95, { opacity: 0, duration: 0.2 })
				// turn on auto-merge
				H.fromTo('#as-cur-2', 0.95, { opacity: 0, x: 40, y: 40 }, { opacity: 1, x: 0, y: 0, duration: 0.4, ease: 'power3.out' })
				H.fromTo('.as-toggle', 1.35, { backgroundColor: 'var(--line)' }, { backgroundColor: 'var(--topic)', duration: 0.25 })
				H.fromTo('.as-toggle .as-knob', 1.35, { x: 0 }, { x: 34, duration: 0.25, ease: 'power2.out' })
			},
			(H) => {
				// on your own domain
				H.to('.as-url-a', 0.3, { opacity: 0, y: -12, duration: 0.3 })
				H.fromTo('.as-url-b', 0.35, { opacity: 0, y: 12 }, { opacity: 1, y: 0, duration: 0.4, ease: 'expo.out' })
			},
		],
	},
	{
		id: 'apps-hood',
		label: 'apps: under the hood',
		topic: 'apps',
		step: 'hood',
		exit: 'wipe',
		nextTopic: 'sharing',
		notes:
			"A request to your subdomain loads your app's fetch handler into a Worker Loader isolate, the same sandbox as execute. Its data lives in a StorageRunner Durable Object: a private SQLite database per storage bucket. (Click) Need realtime? Each session is a Durable Object holding the WebSockets.",
		html: html`
			<h2 class="headline">Each app is a Worker <em>with its own database.</em></h2>
			${diagram(
				[
					{ id: 'ah-req', x: 120, y: 360, w: 380, label: 'kent.kody.run', sub: 'a request', plain: true },
					{ id: 'ah-ld', x: 620, y: 360, w: 450, label: 'Worker Loader', sub: 'your fetch handler', cf: true },
					{ id: 'ah-db', x: 1190, y: 360, w: 610, label: 'StorageRunner', sub: 'Durable Object · SQLite', cf: true },
					{ id: 'ah-rt', x: 1190, y: 680, w: 610, label: 'Realtime session', sub: 'Durable Object · WebSockets', cf: true, cls: 'ah-b' },
				],
				[
					['ah-req', 'ah-ld'],
					['ah-ld', 'ah-db'],
					['ah-ld', 'ah-rt', { from: 'b', to: 'l', cls: 'ah-b' }],
				],
				{ id: 'ah' },
			)}
			${wayfind('apps', 'hood')}`,
		steps: [
			(H) => {
				H.in('#s-apps-hood .node:not(.ah-b)', 0.1, { stagger: 0.12 })
				H.fade('#s-apps-hood .wire-g:not(.ah-b)', 0.5, { stagger: 0.12 })
			},
			(H) => {
				H.in('#ah-rt', 0.5)
				H.fade('#s-apps-hood .wire-g.ah-b', 0.55)
			},
		],
	},

	// ============================================================ sharing
	topicCard('sharing', 'Back to the house. Sharing.'),
	{
		id: 'sharing-solution',
		label: 'sharing: solution',
		topic: 'sharing',
		step: 'solution',
		enter: 'wipe',
		notes:
			"Remember the teammate in the other house? In Kody, sharing is one move: grant a person or a team a role on a resource. A package, an app, a secret, a connection. (Click) And because it's all in one house, whatever agent your teammate uses can use it too.",
		html: html`
			<h2 class="headline">Share anything <em>with anyone.</em></h2>
			<div style="position:absolute;left:120px;right:120px;top:360px;display:flex;align-items:center;justify-content:space-between">
				<div class="sh-col" style="display:flex;flex-direction:column;gap:22px;align-items:flex-start">
					<span class="chip" style="font-size:44px">${person('blue').replace('class="person blue"', 'class="person blue" style="width:56px;height:56px;box-shadow:none"').replace('<svg>', '<svg style="width:32px;height:32px">')}<span>a person</span></span>
					<span class="chip" style="font-size:44px">${person('amber').replace('class="person amber"', 'class="person amber" style="width:56px;height:56px;box-shadow:none"').replace('<svg>', '<svg style="width:32px;height:32px">')}<span>a team</span></span>
				</div>
				<svg class="icon sh-arrow" viewBox="0 0 24 24" style="width:90px;height:90px;color:var(--line-strong)"><path d="M4 12h15"/><path d="m13 6 6 6-6 6"/></svg>
				<div class="sh-col" style="display:flex;flex-direction:column;gap:22px">
					${['use', 'edit', 'admin'].map((r) => `<span class="chip" style="font-size:44px">${r}</span>`).join('')}
				</div>
				<svg class="icon sh-arrow" viewBox="0 0 24 24" style="width:90px;height:90px;color:var(--line-strong)"><path d="M4 12h15"/><path d="m13 6 6 6-6 6"/></svg>
				<div class="sh-col" style="display:flex;flex-direction:column;gap:22px">
					${[
						['packages', 'a package'],
						['apps', 'an app'],
						['credentials', 'a connection'],
					]
						.map(([o, l]) => `<span class="chip" style="font-size:44px;padding:10px 30px 10px 12px">${orb(o, 64, { float: false })}<span>${l}</span></span>`)
						.join('')}
				</div>
			</div>
			<div id="sh-agents" style="position:absolute;left:120px;top:800px;display:flex;gap:22px;align-items:center">
				<span class="label muted" style="margin-right:8px">Through any agent</span>
				${[0, 1, 2, 3].map((i) => `<span class="chip sh-ag" style="padding:14px">${agent('share', i, 56)}</span>`).join('')}
			</div>
			${wayfind('sharing', 'solution')}`,
		steps: [
			(H) => {
				H.in('#s-sharing-solution .sh-col', 0.15, { stagger: 0.18 })
				H.fade('#s-sharing-solution .sh-arrow', 0.4, { stagger: 0.18 })
			},
			(H) => {
				H.fade('#sh-agents .label', 0.4)
				H.in('.sh-ag', 0.45, { stagger: 0.1, y: 16 })
			},
		],
	},
	{
		id: 'sharing-hood',
		label: 'sharing: under the hood',
		topic: 'sharing',
		step: 'hood',
		exit: 'wipe',
		wipeColor: 'cloudflare',
		nextTopic: 'cloudflare',
		notes:
			"How do you keep everyone's room private in one shared house? Every layer is namespaced by owner. D1 rows carry the owner id. Durable Objects are named per owner. Vectorize queries filter by owner. KV and R2 keys are prefixed. (Click) And every request, from every surface, goes through one authorize check. One door policy for the whole house.",
		html: html`
			<h2 class="headline">Every room <em>is namespaced.</em></h2>
			<div id="nh-grid" style="position:absolute;left:120px;right:120px;top:290px;display:grid;grid-template-columns:1fr 1fr;gap:20px 80px">
				${[
					['D1', 'WHERE user_id = ?'],
					['Durable Objects', 'idFromName(userId)'],
					['Vectorize', 'filter: { userId }'],
					['KV', 'user:{id}:…'],
					['R2', '{userId}/…'],
					['Artifacts', 'repo per package'],
				]
					.map(
						([p, k]) =>
							`<div class="nh-row" style="display:flex;align-items:center;gap:22px;padding:22px 0;border-bottom:2px solid var(--line)">${cfLogo(36)}<span class="label" style="width:330px">${p}</span><span style="font-family:ui-monospace,monospace;font-size:34px;color:var(--muted)">${esc(k)}</span></div>`,
					)
					.join('')}
			</div>
			<div class="card" id="nh-auth" style="left:120px;top:800px;padding:26px 40px;display:flex;gap:24px;align-items:center;font-size:42px">
				<span style="font-family:ui-monospace,monospace;font-weight:600;color:color-mix(in oklab,var(--topic) 70%,var(--ink))">authorize()</span>
				<span>One check, every surface.</span>
			</div>
			${wayfind('sharing', 'hood')}`,
		steps: [
			(H) => {
				H.in('.nh-row', 0.1, { stagger: 0.07, y: 16 })
			},
			(H) => {
				H.in('#nh-auth', 0.45)
			},
		],
	},

	// ============================================================ wrap up
	{
		id: 'cloudflare',
		label: 'Built on Cloudflare',
		topic: 'cloudflare',
		exit: 'wipe',
		wipeColor: 'page',
		enter: 'wipe',
		wipeTo: [960, 540],
		notes:
			"Per-person isolates on demand, per-person databases by the million, per-person Git, email, queues, and vector search. All in one platform, all billed by actual use. That's why Kody could only be built on Cloudflare. (Click) And all of it is available to you today.",
		html: html`
			<h2 class="headline">Built entirely <em>on Cloudflare.</em></h2>
			<div id="cf-grid" style="position:absolute;left:120px;right:120px;top:300px;display:grid;grid-template-columns:repeat(3,1fr);gap:34px 60px">
				${['Workers', 'Worker Loaders', 'Durable Objects', 'D1', 'R2', 'KV', 'Vectorize', 'Workers AI', 'Queues', 'Workflows', 'Email Routing', 'Artifacts']
					.map((p) => `<div class="cf-p label" style="display:flex;align-items:center;gap:22px;font-size:52px">${cfLogo(46)}<span>${p}</span></div>`)
					.join('')}
			</div>
			<div class="label" id="cf-today" style="position:absolute;left:120px;bottom:90px;font-size:56px;color:color-mix(in oklab,var(--topic) 70%,var(--ink))">You can start today.</div>`,
		steps: [
			(H) => {
				H.in('.cf-p', 0.3, { stagger: 0.05, y: 20, d: 0.6 })
			},
			(H) => {
				H.in('#cf-today', 0.5)
			},
		],
	},
	{
		id: 'invisible-software',
		label: 'Invisible Software',
		exit: 'wipe',
		wipeColor: 'connect',
		notes:
			"This is the scale I'm building for. Today, tens of millions of developers are creating code with agents. (Click) I think we're heading toward billions of people whose agents create software for them. They don't need to become developers, or even realize software was written. They just want their problems solved. (Click) I call this Invisible Software. That's why I built Kody with this scale in mind. My latest video goes deeper into that vision; the thumbnail and link open it. Then: thank you, and come build with us.",
		html: html`
			<h2 class="headline" id="is-title">Invisible <em>Software.</em></h2>
			<div id="is-today" style="position:absolute;left:120px;top:300px;width:820px">
				<div class="display" style="font-size:72px;font-weight:700;letter-spacing:-0.035em">Tens of millions</div>
				<div style="font-size:44px;color:var(--muted);margin-top:8px">of developers</div>
			</div>
			<div id="is-arrow" aria-hidden="true" style="position:absolute;left:120px;top:490px;font-size:76px;color:var(--accent)">↓</div>
			<div id="is-future" style="position:absolute;left:120px;top:615px;width:820px">
				<div class="display" style="font-size:118px;font-weight:760;line-height:1;color:var(--accent);letter-spacing:-0.04em">Billions</div>
				<div style="font-size:52px;margin-top:12px">of people</div>
			</div>
			<a id="is-video" href="https://www.youtube.com/watch?v=P00lzZaxv8U" target="_blank" rel="noopener noreferrer" aria-label="Watch The Future of Software is Invisible on YouTube" style="position:absolute;left:1040px;top:310px;width:760px;display:block;color:var(--ink);text-decoration:none">
				<img src="assets/img/invisible-software-thumbnail.png" alt="They’re coming for you: Kent beside an app with a cancel subscription button" style="width:760px;height:427.5px;display:block;border-radius:24px;box-shadow:var(--shadow)" />
				<div class="label" style="font-size:34px;margin-top:28px">Watch: The Future of Software is Invisible ↗</div>
				<div style="font-size:30px;color:var(--muted);margin-top:10px">youtu.be/P00lzZaxv8U</div>
			</a>
			<div id="is-why" style="position:absolute;left:120px;top:925px;font-size:44px">Their agents build it. They just get on with life.</div>`,
		steps: [
			(H) => {
				H.in('#is-today', 0.15, { y: 24 })
			},
			(H) => {
				H.in('#is-arrow', 0, { y: -20 })
				H.in('#is-future', 0.1, { y: 32 })
			},
			(H) => {
				H.in(['#is-title', '#is-video'], 0.1, { y: 24 })
				H.in('#is-why', 0.3, { y: 16 })
			},
		],
	},
	{
		id: 'thanks',
		label: 'Thank you',
		connect: true,
		exit: 'none',
		notes: 'Thank you! Scan the code or go to kody.codes. Connect it to the agent you already use. I would love to hear what you build.',
		html: html`
			<div class="cx-top cx-in">
				<span class="cx-track"><img src="assets/img/connect-cloud-white.svg" alt="" />Agent Cloud</span>
				<img class="cx-mark" src="assets/img/connect-cloud-white.svg" alt="Cloudflare" />
			</div>
			<div id="ty-text" style="position:absolute;left:96px;top:270px">
				<h2 class="cx-h1" style="font-size:168px">Thank you.</h2>
				<div class="cx-h1" style="font-size:96px;margin-top:20px">kody.codes</div>
			</div>
			<div id="ty-qr" style="position:absolute;left:96px;top:600px;display:flex;align-items:center;gap:36px">
				<div style="width:230px;height:230px;padding:18px;border-radius:20px;background:#fff">
					<img src="assets/img/qr-connect-kody.svg" alt="QR code for kcd.link/connect-kody" style="width:100%;height:100%;display:block" />
				</div>
				<div>
					<div class="cx-name" style="font-size:42px;line-height:1.15">The shared cloud for</div>
					<div class="cx-name" style="font-size:42px;line-height:1.15">your team's agents</div>
				</div>
			</div>
			<div id="ty-kody" style="position:absolute;right:40px;top:140px;width:760px;height:760px">
				<img class="amb-sway" src="assets/img/kody-base.webp" alt="Kody holding the lantern" style="width:100%;height:100%" />
			</div>
			<div class="cx-wordmark cx-in">connect 2026</div>`,
		steps: [
			(H) => {
				H.in('#s-thanks .cx-top', 0.05)
				H.in('#ty-text', 0.1)
				H.in('#ty-qr', 0.3)
				H.in('#ty-kody', 0.2, { y: 60, scale: 0.94, d: 1.1 })
				H.in('#s-thanks .cx-wordmark', 0.4)
			},
		],
	},
]