Skip to content
satin

Agent action log

Pro

What a coding agent changed, run by run: files with their diff counts, a Revert on each, ⌘Z for the last run.

    • Createdsrc/middleware/rate-limit.ts+48
    • Editedsrc/routes/auth.ts+6−2
    • Editedtest/auth.test.ts+31−4
    • Pushedfeat/rate-limit → origin

      Can't be reverted: Pushed commits stay on the remote. Revert them with a new commit.

    • Editedsrc/api/users.ts+4−4
    • Editedsrc/routes/profile.ts+2−2
    • Editedsrc/routes/admin.ts+2−2

    Installation

    Terminal
    npm i @uisatin/ui @uisatin/pro
    Import
    import '@uisatin/ui/styles.css'
    import '@uisatin/pro/styles.css'
    import { AgentActionLog, type AgentRun } from '@uisatin/pro/agent-undo-log'

    Part of Satin Pro, the licensed edition: @uisatin/pro on top of @uisatin/ui at the same version, its stylesheet after Free's. Satin Pro isn't on npm yet.

    About 5.5 kB of JavaScript, minified and gzipped, on top of the @uisatin/uicomponents it uses (React aside).

    First time with Satin? Set it up once, styles and fonts included, with the installation guide.

    API Reference

    The AgentActionLog component (Satin Pro, @uisatin/pro/agent-undo-log) is a section that lists what an agent did, run by run, with a Revert on every action it can undo. Made for coding agents first: an action is { id, label, target?, added?, removed?, icon?, description?, changes?, at?, revertible?, reason? }, one line like a Thinking tool step ("Edited" src/routes/auth.ts +6 −2) with a quiet Revert icon button; changes adds AgentSuggestionChanges rows for other agents, and revertible: false with a reason shows a lock and says why. A run is { id, label, at, actions, icon? }, its actions in the order they happened. onRevert may return a promise: the button shows a Spinner until it settles, and a rejection marks the line "Couldn't revert" (with the Error's message) and Try again. Each revert ends with a toast (it needs the app's <Toaster />) whose Undo calls onRestore. Revert run and ⌘Z (Ctrl+Z off Apple) revert what is left of the newest run, newest action first, through onRevertRun when given. Parts: AgentActionLogRoot, AgentActionLogRun, AgentActionLogAction (its state sets a line yourself).

    PropTypeDefault
    runs
    AgentRun[]
    —
    onRevert
    (action, run) => unknown
    —
    onRevertRun
    (run, actions) => unknown
    —
    onRestore
    (actions, run) => unknown
    —
    reverted
    string[]
    —
    defaultReverted
    string[]
    []
    onRevertedChange
    (reverted: string[]) => void
    —
    expanded
    string[]
    —
    defaultExpanded
    string[]
    the first run
    onExpandedChange
    (expanded: string[]) => void
    —
    shortcut
    "document""log""off"
    "document"
    formatTime
    (at: Date) => ReactNode
    time of day, date when not today
    className
    string
    —
    ref
    Ref<HTMLElement>
    —
    ...props
    ComponentProps<'section'>

    Other attributes go to <section>

    —

    Accessibility

    A section named "Agent actions" (actionLog in SatinLabels, or your aria-label), so it is a region landmark, around a list of runs. Each run's header is a button with aria-expanded and aria-controls, read as its name, how many actions and when; a closed run's actions leave the accessibility tree. Every Revert is an icon button named after its action and target ("Revert Edited src/routes/auth.ts"), with a tooltip, and stays the one focused button through the revert: busy (aria-busy) while it runs, then Restore, or Reverted with aria-disabled, or Try again after a failure, whose reason is shown as text. An action that can't be reverted has no button (its lock is hidden); its reason is read with "Can't be reverted:" before it. The glyphs and the rail are hidden. Failures and restores are read from a polite status region; a revert is read out by its toast, whose Undo screen readers hear as "Restore it from the action log", since the row's Restore does the same. The button of the run ⌘Z would revert carries aria-keyshortcuts and shows the keys as Kbd. Reverted rows are struck through and muted, and say so in their button.

    KeyAction
    TabMoves through the run headers, the Revert run buttons and the open runs' Revert buttons.
    EnterorSpaceOn a run header: opens or closes its actions. On a button: reverts, restores or tries again.
    ⌘ZorCtrl+ZReverts what is left of the newest run and opens it: ⌘Z on Apple, Ctrl+Z elsewhere. Anywhere on the page by default (shortcut="log": only while focus is in the log). Left alone while typing in a field, and when there is nothing left to revert.