Steps and Tool Calls

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
  1. Read src/auth/links.ts0.2s
    Input
    { "path": "src/auth/links.ts" }
    Result
    export const LINK_TTL = Duration.minutes(10)
    …48 more lines
  2. Searched for LINK_TTL0.4s
    Input
    { "query": "LINK_TTL", "glob": "src/**/*.ts" }
    Result
    src/auth/links.ts:4
    src/auth/links.test.ts:12
    src/mail/queue.ts:31
  3. Ran bun test src/auth6.1s
    Input
    bun test src/auth
    Result
    ✗ links > a late email still signs in
      expected 200, got 410 Gone
  4. Open a pull request

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/steps

Usage

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.

  1. Built billing-api #2181m 12s
    Result
    image sha256:9f2c…e41a
  2. Deployed to staging and ran smoke tests48s
    Result
    14 of 14 checks passed
  3. Deploy billing-api build 218 to production
    Input
    { "service": "billing-api", "build": 218, "env": "production" }

    Deploy build 218 to production

    Scout wants todeploys.create
    Service
    billing-api
    Changes
    Sign-in links last 30 minutes

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
Looking for the money…

API reference

StepsView function

Options

Steps options
NameTypeDefaultDescription
stepsrequiredStep[]—What the agent did, in order: each tool call, command or app action
labelstring"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.
keystring—Gives the copy buttons of input and result keys of their own when several lists share a parent

ChecklistView function

Options

Checklist options
NameTypeDefaultDescription
itemsrequiredChecklistItem[]—The plan's items, in order, each not started, in progress or done
labelstring"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.

Source