What an agent did, step by step, with each tool's input and result.
- Find where link lifetime is set
- Raise it to 30 minutes and fix the tests
- Open a pull request
Read src/auth/links.ts0.2s
Input{ "path": "src/auth/links.ts" }Resultexport const LINK_TTL = Duration.minutes(10) …48 more lines
Searched for LINK_TTL0.4s
Input{ "query": "LINK_TTL", "glob": "src/**/*.ts" }Resultsrc/auth/links.ts:4 src/auth/links.test.ts:12 src/mail/queue.ts:31
Ran bun test src/auth6.1s
Inputbun test src/auth
Result✗ links > a late email still signs in expected 200, got 410 Gone
1 of 38 tests failed: a link sent 20 minutes ago is already expired.
import { Command, UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Effect, Schema } from "effect"import { Checklist, type Step, Steps } from "./ui/uicontext/components/kit/Steps.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { space } from "./ui/uicontext/components/tokens.stylex.ts"const initial: ReadonlyArray<Step> = [ { id: "s1", title: "Read src/auth/links.ts", status: "succeeded", duration: "0.2s", input: '{ "path": "src/auth/links.ts" }', result: "export const LINK_TTL = Duration.minutes(10)\n…48 more lines", }, { id: "s2", title: "Searched for LINK_TTL", status: "succeeded", duration: "0.4s", input: '{ "query": "LINK_TTL", "glob": "src/**/*.ts" }', result: "src/auth/links.ts:4\nsrc/auth/links.test.ts:12\nsrc/mail/queue.ts:31", }, { id: "s3", title: "Ran bun test src/auth", status: "failed", duration: "6.1s", input: "bun test src/auth", result: "✗ links > a late email still signs in\n expected 200, got 410 Gone", error: "1 of 38 tests failed: a link sent 20 minutes ago is already expired.", }, { id: "s4", title: "Open a pull request", status: "queued" },]const Message = UiSchema.TaggedEnum({ ClickedRetry: { step: Schema.String }, CompletedRetry: { step: Schema.String },})// Stands in for running the tool again: two seconds, then it passes.const RunAgain = Command.make("RunStepAgain", { args: { step: Schema.String } }, ({ step }) => Effect.sleep("2 seconds").pipe(Effect.as(Message.CompletedRetry({ step }))),)const styles = stylex.create({ frame: { display: "grid", gap: space.xl, inlineSize: "min(100%, 38rem)" },})export const AgentRun = Html.component({ name: "AgentRun", model: Schema.Struct({ retried: Schema.Literals(["no", "running", "passed"]) }), message: Message,}).make({ init: () => ({ retried: "no" as const }), update: { ClickedRetry: ($, { step }) => $.model.retried === "running" ? $.model : $.evolve({ retried: "running" }).run(RunAgain.make({ step })), CompletedRetry: ($) => $.evolve({ retried: "passed" }), }, view: (h, model) => { const steps = initial.map((step): Step => { if (step.id !== "s3" || model.retried === "no") return step const { error: _, result: __, ...rest } = step return model.retried === "running" ? { ...rest, status: "running", duration: "" } : { ...rest, status: "succeeded", duration: "5.8s", result: "✓ 38 passed" } }) return h.div.attrs(sx(styles.frame)).children( Checklist(h, { label: "Plan", items: [ { id: "p1", label: "Find where link lifetime is set", status: "done" }, { id: "p2", label: "Raise it to 30 minutes and fix the tests", status: model.retried === "passed" ? "done" : "in-progress" }, { id: "p3", label: "Open a pull request", status: "not-started" }, ], }), Steps(h, { key: "steps-demo", label: "Tool calls", steps, onRetry: (step) => Message.ClickedRetry({ step: step.id }), }), ) },})Installation
pnpm dlx shadcn@latest add checkfu/uicontext/stepsUsage
import { type Step, Steps } from "./ui/uicontext/components/kit/Steps.ts"const Message = UiSchema.TaggedEnum({ ClickedRetryStep: { step: Schema.String } })// your app maps each tool call of the run to a step: its status, input and result as textexport const ToolCalls = (h: Html.H<typeof Message.Type>, steps: ReadonlyArray<Step>) => Steps(h, { key: "run-218", label: "What the agent did", steps, onRetry: (step) => Message.ClickedRetryStep({ step: step.id }), })Examples
A step that waits for approval
The run stops at a step that needs a person. The approval sits under that step; once answered, the step runs or is refused.
Built billing-api #2181m 12s
Resultimage sha256:9f2c…e41a
Deployed to staging and ran smoke tests48s
Result14 of 14 checks passed
Deploy billing-api build 218 to production
Input{ "service": "billing-api", "build": 218, "env": "production" }
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import type { Actor } from "./ui/uicontext/components/domain/Actor.ts"import { Approval, ApprovalState } from "./ui/uicontext/components/kit/Approval.ts"import { type Step, Steps } from "./ui/uicontext/components/kit/Steps.ts"import { sx } from "./ui/uicontext/components/Sx.ts"const scout: Actor = { id: "scout", name: "Scout", kind: "agent" }const ada: Actor = { id: "ada", name: "Ada Lovelace", kind: "person" }const Message = UiSchema.TaggedEnum({ ChoseDeploy: { choice: Schema.String } })const styles = stylex.create({ frame: { inlineSize: "min(100%, 38rem)" } })export const GatedRun = Html.component({ name: "GatedRun", model: Schema.Struct({ state: ApprovalState }), message: Message,}).make({ init: () => ({ state: { _tag: "Pending" as const } }), update: { // the app records the answer; a real one would also resume the run ChoseDeploy: ($, { choice }) => $.evolve({ state: { _tag: "Answered", choice, actor: ada, at: "2026-12-01T10:02:00Z" } }), }, view: (h, model) => { const answered = model.state._tag === "Answered" ? model.state.choice : null const deploy: Step = { id: "deploy", title: "Deploy billing-api build 218 to production", status: answered === null ? "waiting" : answered === "deploy" ? "running" : "refused", input: '{ "service": "billing-api", "build": 218, "env": "production" }', ...(answered === "deny" ? { error: "Ada denied the deploy." } : {}), } const steps: ReadonlyArray<Step> = [ { id: "build", title: "Built billing-api #218", status: "succeeded", duration: "1m 12s", result: "image sha256:9f2c…e41a" }, { id: "staging", title: "Deployed to staging and ran smoke tests", status: "succeeded", duration: "48s", result: "14 of 14 checks passed" }, deploy, ] return h.div.attrs(sx(styles.frame)).children( Steps(h, { key: "steps-gate", label: "Release run", steps, detail: (step) => step.id === "deploy" ? Approval(h, { props: { id: "deploy-218", title: "Deploy build 218 to production", fields: [ { label: "Service", value: "billing-api" }, { label: "Changes", value: "Sign-in links last 30 minutes" }, ], digest: "deploy:billing-api:218", actor: scout, tool: "deploys.create", choices: [ { id: "deny", label: "Deny", dismiss: true }, { id: "deploy", label: "Deploy", primary: true }, ], can: ["answer"], state: model.state, timeZone: "UTC", }, onEmit: { Chose: ({ choice }) => Message.ChoseDeploy({ choice }) }, }) : undefined, }), ) },})An assistant's live plan
The job in one sentence, then the plan in plain verbs: done steps step back, the current one is bold with an open ring, and one shimmering line says what it's on.
I'll check the invoice, then what Alder says they sent, then whether the money ever arrived.
- Open invoice 4410
- Read what Alder sent
- Look for the money
- Match it to the invoice
import type { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Checklist } from "./ui/uicontext/components/kit/Steps.ts"import { Thinking } from "./ui/uicontext/components/kit/Stream.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, radius, space } from "./ui/uicontext/components/tokens.stylex.ts"const styles = stylex.create({ column: { display: "flex", flexDirection: "column", gap: space.md, width: "min(100%, 34rem)" }, text: { margin: 0, fontSize: 15, lineHeight: 1.55, color: color.fg }, card: { paddingBlock: space.sm, paddingInline: space.lg, borderRadius: radius.lg, borderWidth: 1, borderStyle: "solid", borderColor: color.line },})export const LivePlan = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.column)).children( h.p.attrs(sx(styles.text)).children("I'll check the invoice, then what Alder says they sent, then whether the money ever arrived."), h.div.attrs(sx(styles.card)).children(Checklist(h, { look: "plan", items: [ { id: "open", label: "Open invoice 4410", status: "done" }, { id: "read", label: "Read what Alder sent", status: "done" }, { id: "look", label: "Look for the money", status: "in-progress" }, { id: "match", label: "Match it to the invoice", status: "not-started" }, ], })), Thinking(h, "Looking for the money…"), )API reference
StepsView function
Options
| Name | Type | Default | Description |
|---|---|---|---|
stepsrequired | Step[] | — | What the agent did, in order: each tool call, command or app action |
label | string | "Steps" | The list's accessible name; "Steps" by default |
onRetry | (step: Step) => Message | — | A failed step's Retry: the message to send, or undefined where it can't be retried |
detail | (step: Step) => View.Input<Message, R> | — | What shows under a step without opening it, such as the Approval a waiting step needs before it runs. Return undefined for none. |
key | string | — | Gives the copy buttons of input and result keys of their own when several lists share a parent |
ChecklistView function
Options
| Name | Type | Default | Description |
|---|---|---|---|
itemsrequired | ChecklistItem[] | — | The plan's items, in order, each not started, in progress or done |
label | string | "Plan" | The list's accessible name; "Plan" by default |
look | "list" | "plan" | — | "plan" reads as an assistant's live plan in a card: done items get a green check and step back, the current one an open ring and bold text, the rest a gray ring. |
Accessibility
- Steps are an ordered list, and each step is a native disclosure: Enter or Space on its title shows its input and result.
- Each step's status is said in words beside its title, never by color alone.
- A checklist is a live list, so screen readers hear the plan change as the agent works through it.