An agent's run folded into "Worked for 2m 30s", opening to past-tense receipts and the actions it took in each page.
Worked for 2m 30s
- Opened the data room · 5 filesNavigate to URL
- Read Halden-usage-Q4.xlsx · 9,100 workflows in November
- Read #acct-halden · 12 messagesScrollTake screenshot
- Skipped: check the CRM · CRM isn't connected
- Added slide 8 to Halden-Account-Plan.pptx · in the deck's style
Done — I added an executive-ready forecast slide as slide 8, in the deck's own style.
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { RunSummary, type RunReceipt } from "./ui/uicontext/components/kit/RunSummary.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, space } from "./ui/uicontext/components/tokens.stylex.ts"const receipts: ReadonlyArray<RunReceipt> = [ { id: "1", kind: "file", text: "Opened the data room", detail: "5 files", actions: ["Navigate to URL"] }, { id: "2", kind: "sheet", text: "Read Halden-usage-Q4.xlsx", detail: "9,100 workflows in November" }, { id: "3", kind: "connector", text: "Read #acct-halden", detail: "12 messages", actions: ["Scroll", "Take screenshot"] }, { id: "4", kind: "connector", text: "Skipped: check the CRM", problem: "CRM isn't connected" }, { id: "5", kind: "slides", text: "Added slide 8 to Halden-Account-Plan.pptx", detail: "in the deck's style" },]const Message = UiSchema.TaggedEnum({ ToggledRun: { open: Schema.Boolean } })const styles = stylex.create({ frame: { display: "flex", flexDirection: "column", gap: space.md, width: "min(100%, 36rem)" }, reply: { margin: 0, fontSize: font.base, lineHeight: 1.6, color: color.fg },})export const FinishedRun = Html.component({ name: "RunSummaryExample", model: Schema.Struct({ open: Schema.Boolean }), message: Message,}).make({ init: () => ({ open: false }), update: { ToggledRun: ($, { open }) => $.evolve({ open }) }, view: (h, model) => h.div.attrs(sx(styles.frame)).children( RunSummary(h, { seconds: 150, running: false, receipts, open: model.open, onToggle: (open) => Message.ToggledRun({ open }) }), h.p.attrs(sx(styles.reply)).children("Done — I added an executive-ready forecast slide as slide 8, in the deck's own style."), ),})Installation
pnpm dlx shadcn@latest add checkfu/uicontext/run-summaryUsage
import { RunSummary } from "./ui/uicontext/components/kit/RunSummary.ts"const Message = UiSchema.TaggedEnum({ ToggledRun: { id: Schema.String, open: Schema.Boolean } })// "Worked for 2m 30s" once done; whether it's open is yoursexport const Run = (h: Html.H<typeof Message.Type>, open: boolean) => RunSummary(h, { seconds: 150, running: false, receipts: [{ id: "r1", kind: "browser", text: "Opened the pricing page", actions: ["Navigate to URL", "Click"] }], open, onToggle: (isOpen) => Message.ToggledRun({ id: "run-1", open: isOpen }), })Examples
While it works
Open on its own, with how long it has worked and what it's on now; receipts slide in as they land.
Working · 42s· Reading Quillstack's pricing…
- Opened fernway.example/pricingNavigate to URLScrollTake screenshot
- Opened quillstack.example/pricingNavigate to URLClick
import type { Html } from "@effect/ui/html"import { RunSummary } from "./ui/uicontext/components/kit/RunSummary.ts"export const Running = <M>(h: Html.H<M>) => RunSummary(h, { seconds: 42, running: true, current: "Reading Quillstack's pricing", receipts: [ { id: "1", kind: "browser", text: "Opened fernway.example/pricing", actions: ["Navigate to URL", "Scroll", "Take screenshot"] }, { id: "2", kind: "browser", text: "Opened quillstack.example/pricing", actions: ["Navigate to URL", "Click"] }, ], })API reference
ReceiptView function
Options
| Name | Type | Description |
|---|---|---|
idrequired | string | — |
kindrequired | "browser" | "computer" | "file" | "connector" | "search" | "sheet" | "document" | "slides" | "mail" | "think" | — |
textrequired | string | What it did, in the past tense: "Opened the data room" |
detail | string | A quieter second part: the file, the site, "3 files" |
actions | string[] | What it did inside a page, in order: "Click", "Navigate to URL", "Take screenshot" |
problem | string | Skipped for want of access, or failed: said in place of the detail |
RunSummaryView function
Options
| Name | Type | Description |
|---|---|---|
secondsrequired | number | How long the run has worked, or worked in all |
runningrequired | boolean | — |
receiptsrequired | RunReceipt[] | What it did, oldest first |
current | string | What it's on now, while running: "Using the browser" |
open | boolean | Open: the receipts show. Left out: open while running. |
onToggle | (open: boolean) => Message | — |
style | Style | — |