# Reasoning

The agent's stated reasoning above its answer. Each step says what it rests on: verified against evidence, believed, or assumed (with the assumption spelled out). Open while the agent is thinking; folds to a one-line summary when it answers.

- Registry name: `reasoning` (`@candor/reasoning`)
- Tier: Free (MIT). No licence key needed.
- Docs: https://candor.themethodic.com/docs/reasoning

## Install

```bash
npx candor-ui add reasoning
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/reasoning`.
It brings in: chat, collapsible, locale, streaming-text, utils.
npm packages: lucide-react@^1.67.0.

## Example

```tsx
"use client"

import { Reasoning } from "@/components/reasoning"

export default function Example() {
  return (
    <Reasoning
      className="max-w-lg"
      thoughtFor="4s"
      entries={[
        { id: "1", title: "The order shipped today", basis: "verified", evidence: "Order record, shipped_at 09:14" },
        { id: "2", title: "Delivery takes three days", basis: "believed", assumption: "The carrier’s usual time for this route" },
        { id: "3", title: "No holiday delays this week", basis: "assumed", assumption: "Not checked against the carrier’s calendar" },
      ]}
    />
  )
}
```

## <Reasoning>

Props:

- `entries: ReasoningEntry[]`: The steps, each verified (with evidence), believed or assumed.
- `thinking?: boolean | undefined` (default `false`): The agent is still thinking; opens the panel and shows progress.
- `thoughtFor?: string | undefined`: How long it thought, once known, e.g. "6s".
- `className?: string | undefined`

## Strings (`reasoning`)

The fixed words, English by default. Override any of them under `reasoning` in `<LocaleProvider strings={{ reasoning: { … } }}>`; the table is exported as `reasoningStrings`.

- `verified`: Verified
- `believed`: Believed
- `assumed`: Assumed
- `reasoning`: Reasoning
- `steps`: { one: "{count} step", other: "{count} steps" }
- `assumedCount`: {count} assumed
- `thinking`: Thinking
- `evidence`: Evidence:
- `assumption`: Assumption:

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
