With this, your mind can give its members a home for their agents: a first-message box, recent work, and a chat that stays with each agent’s durable log. This is a privileged workbench, not a chatbot exposed to visitors. Starting an ordinary agent gives it the mind’s reach; moving the chat into a pretty page does not make that safe for strangers.
A small host, a reusable UI
apps/agents/app.ts installs the Agents app through installAgents from iterate/agents/install, pointing it at apps/agents/backend.ts. The backend re-exports the platform’s agent classes and chooses existing model funding and standing instruction files. index.html pins browser package versions; public/app.js wires the catalog, chat and agent kinds; public/home.js handles the first message and recent rows. Navigation and row helpers are separate local files rather than duplicated behavior in each view.
import { agentsApp } from "./apps/agents/app.ts";
const agents = agentsApp();
// Run agents.install(itx) in the idempotent publish hook.
case "agents":
return agents.open?.(request) ||
this.auth.require(request) || agents.fetch(request, this);
The open exception serves a narrowly allowlisted icon or app manifest, not chats or the member socket. The guarded /itx route calls host.auth.itx(request). The browser opens a WebSocket on that same host and wraps it with the UI kit’s capnweb session helper. The platform decides the principal and ends the socket when the sign-in ends; browser-supplied identity is not trusted. Three compatibility endpoints describe the one mind, the session issuer and sign-out for the UI shell.
Agents are contexts with a kind
The catalog and chat are backed by agent contexts under /agents, not a second database inside the page. The first message creates an agent and sends a message through its facet. The ordinary iterate kind uses the platform runtime; other kind modules offer coding runners or different views. agent-kinds/ files name their kind, optional start choices, event processing and view. worker.ts registers the kinds alongside integrations. Private model and tool events remain within the member boundary; this introduction contains no conversation examples from real work.
Copy the boundary as well as the files
A similar app needs the iterate agent runtime, the UI kit at a tested pinned version, and existing model funding: a suitable connected plan, API key or gateway credit. A different runner can need its own sandbox or computer. None of this requires transferring our subscriptions or secrets. Preserve the guarded socket and route every chat action as the signed-in member. A public sales or install conversation needs a separate restricted backend, not this ordinary workbench. Coding agents describes the runner side; onboarding shows a narrower member page using one fixed agent; the blog records changes as recipes.