Status

Free · MIT

A status's label in the current locale: const label = useStatusLabel(); label("running").

Markdown

Preview

It's types and helpers, listed below.

Install

With the Candor CLI

First time? Get started sets up the registry and theme. Or with shadcn directly: npx shadcn@latest add @candor/status

Brings in: locale

Functions

useStatusLabel()

A status's label in the current locale: const label = useStatusLabel(); label("running").

isTerminal(status: RunStatus)
runLiveness(run: { status: RunStatus; lastHeardAt?: Date | string | undefined; hostOffline?: HostOffline | undefined }, now: number | null, staleAfter = STALE_AFTER)

Strings

The fixed words, in English by default. Change any of them under status in <LocaleProvider strings={{ … }}>; the table is exported as statusStrings.

KeyEnglish
idleNot started
queuedQueued
runningRunning
waitingNeeds you
blockedBlocked
succeededDone
failedFailed
cancelledCancelled
skippedSkipped

Types

RunStatus
The status vocabulary every Candor agent component shares. Components take plain data in these shapes rather than an SDK's message objects, so they work with your own LLM drivers, the Vercel AI SDK or anything else; adapters map an SDK's parts onto them.
| "idle" // not started | "queued" // accepted, waiting for a worker | "running" // an agent is working on it now | "waiting" // stopped to ask a person (approval, question) | "blocked" // can't start: something it depends on failed or is waiting | "succeeded" | "failed" | "cancelled" | "skipped"
HostOffline
The machine or worker a run is on, when the app can't reach it.
{ /** The host's name as the app knows it: "Build runner 3", "Priya’s laptop". Left out, it's "The host". */ host?: string | undefined /** When the app lost contact. */ since?: string | undefined }
RunLiveness
Whether a run can be called alive. "live": heard from recently, or the app doesn't track it. "stale": running, but nothing heard for longer than `staleAfter`, so it may have stopped. "offline": its host can't be reached. "unchecked": there's no clock yet (rendering on the server), so freshness isn't claimed either way. "settled": it has finished, so silence is expected. Only a running run goes stale: a queued or waiting one is quiet by design.
"live" | "stale" | "offline" | "unchecked" | "settled"