Pilot
How Firm Pilot shows its work in chat: each tool call as a trace line, its reasoning collapsed to one line, a turn's steps on a timing waterfall, and the cards it asks the lawyer to act on.
BetaReady to use. Its API can still change in a minor release; the changelog says when.
LEAP CRMBuilt for the CRM from the core library. It knows about the CRM's own records, so it isn't a general building block.
import { PilotToolCall, PilotReasoning, PilotTrace, PilotApprovalCard, PilotPermissionRequest } from "@leap-crm/design-system";Playground
Change a prop and the component follows. Its code is under Props.
Props
Best practices
When to use it, and the rules that apply in particular places.
| Guidance | Practice |
|---|---|
| Do | Write a tool call's title in its tense: “Searching contacts” while it runs, “Searched contacts” once it's done. |
| Do | Use PilotPermissionRequest for a write Firm Pilot holds for approval, so the held tool row sits directly above its card. Use PilotApprovalCard alone for a choice that holds no write. |
| Do | Mark one option primary, the action the card exists for, and a delete or discard destructive. The rest render as outline buttons. |
| Do | Return a Promise from onSelect, so the chosen button spins until it settles and then shows a tick or a cross. |
| Do | Set readOnly without selectedValue when a card has gone stale. It swaps its buttons for a line saying so, since faded buttons invite a tap that does nothing. |
| Don't | Open PilotReasoning by default once Firm Pilot has finished. It collapses to one line, like “Reasoned for 4s”, so the answer leads and the lawyer opens the reasoning when they want it. |
Props
PilotToolCall
| Prop | Type | Default | Description |
|---|---|---|---|
| title * | string | — | What the call does, in its tense: "Searching contacts", "Searched contacts". |
| icon * | ReactNode | — | The tool's 14 px icon; it takes the state's tone. |
| state * | "running" | "done" | "failed" | "held" | "recovered" | — | running, done, failed, held (waiting on a person) or recovered. |
| heldChange | string | — | For a held write: what it will change, after the title. |
| duration | number | — | Seconds the call took. Not shown while it runs. |
| children | ReactNode | — | What the row shows when opened, on a line down its left. |
| open | boolean | — | Whether it's open, when you control it. |
| defaultOpen | boolean | — | Whether it starts open, when it controls itself. |
| onOpenChange | (open: boolean) => void | — | Runs when it opens or closes, with whether it's now open. |
PilotReasoning
| Prop | Type | Default | Description |
|---|---|---|---|
| streaming | boolean | false | Firm Pilot is still reasoning: the brain breathes and the label says so. |
| duration | number | — | Seconds it reasoned for, once done. |
| children | ReactNode | — | The reasoning, as prose. |
| open | boolean | — | Whether it's open, when you control it. |
| defaultOpen | boolean | false | Collapsed by default once done. |
| onOpenChange | (open: boolean) => void | — | Runs when it opens or closes, with whether it's now open. |
PilotTrace
| Prop | Type | Default | Description |
|---|---|---|---|
| steps * | PilotTraceStep[] | — | The tool calls, in order, each as a PilotToolCall's props. |
| total | number | — | The turn's whole time in seconds. Defaults to the end of the last step. |
| open | boolean | — | Whether it's open, when you control it. |
| defaultOpen | boolean | false | Whether it starts open, when it controls itself. |
| onOpenChange | (open: boolean) => void | — | Runs when it opens or closes, with whether it's now open. |
PilotApprovalCard
| Prop | Type | Default | Description |
|---|---|---|---|
| title * | ReactNode | — | What Firm Pilot wants to do, as a question or statement. |
| details | { label: string; value: ReactNode }[] | [] | Label and value rows under the title. |
| options * | PilotCardOption[] | — | The choices, as buttons. One is primary: the action the card exists for. |
| onSelect * | (value: string) => unknown | — | Runs with the chosen option's value. Return a Promise and the button spins until it settles, then draws a tick (or a cross if it fails). |
| readOnly | boolean | false | No longer actionable: after a pick, or when the card has gone stale. |
| selectedValue | string | — | The option the lawyer picked, once they have. |
| children | ReactNode | — | Extra content between the details and the actions, like an email draft. |
PilotPermissionRequest
| Prop | Type | Default | Description |
|---|---|---|---|
| title * | ReactNode | — | What Firm Pilot wants to do, as a question or statement. |
| details | { label: string; value: ReactNode }[] | — | Label and value rows under the title. |
| options * | PilotCardOption[] | — | The choices, as buttons. One is primary: the action the card exists for. |
| onSelect * | (value: string) => unknown | — | Runs with the chosen option's value. Return a Promise and the button spins until it settles, then draws a tick (or a cross if it fails). |
| readOnly | boolean | — | No longer actionable: after a pick, or when the card has gone stale. |
| selectedValue | string | — | The option the lawyer picked, once they have. |
| children | ReactNode | — | Extra content between the details and the actions, like an email draft. |
| toolTitle * | string | — | The held write's title, like "Update Jane Citizen's email". |
| toolIcon * | ReactNode | — | The icon of the tool asking, as on its tool call. |
| heldChange | string | — | What the held write will change, after the tool's title. |
Code
What the playground shows, ready to copy.
import { PilotToolCall, PlusIcon } from "@leap-crm/design-system";
<PilotToolCall
title="Searched contacts"
state="done"
icon={<PlusIcon />}
/>Reasoning
Reasoning... while Firm Pilot thinks, with the brain breathing; Reasoned for 4s once done, collapsed by default.
Trace waterfall
A turn's steps with their timing on a shared scale. A retried first try's bar is grey, a failure's red. The bars are decoration; durations stay as text.
- 1.2sSearched contacts
- 2.1sRead Agency Purchase
- 0.6sReading the matterRetried
- 2.9sRead the matter
Settling
When a call you watched running finishes, its icon turns into a tick that draws itself in (or a cross if it failed), holds a moment, then turns back into the tool's icon in its new tone. A call that arrives already settled just shows its icon, so a long trace doesn't flash.
Approval card
Primary for the one action the card exists for, Outline for others, Destructive for discarding. Pick one: it spins while onSelect's Promise runs, then resolves into a tick that stays on the chosen button, and the others fade. A stale card swaps its buttons for a line saying so.
Update Jane Citizen
- jane@citizenlegal.com.au
- Phone
- 0400 000 000
- Source
- Signature in her 14 Nov email
Update Jane Citizen
- jane@citizenlegal.com.au
- Phone
- 0400 000 000
- Source
- Signature in her 14 Nov email
This card is no longer current — ask Firm Pilot to show it again.
Permission request
A write Firm Pilot holds for approval: the held tool row directly above its card.
Update Jane Citizen
- jane@citizenlegal.com.au
- Phone
- 0400 000 000
- Source
- Signature in her 14 Nov email
What the examples share
The imports and the scaffolding the examples above call. The scaffolding lives in this page, not in the library.
import { FileText, Pencil, Search } from "lucide-react";
import { useState } from "react";
import { Button, PilotApprovalCard, PilotPermissionRequest, PilotReasoning, PilotToolCall, PilotTrace } from "@leap-crm/design-system";
const options = [
{ value: "approve", label: "Approve", variant: "primary" as const },
{ value: "edit", label: "Edit first" },
{ value: "discard", label: "Discard", variant: "destructive" as const },
];
const details = [
{ label: "Email", value: "jane@citizenlegal.com.au" },
{ label: "Phone", value: "0400 000 000" },
{ label: "Source", value: "Signature in her 14 Nov email" },
];
const wait = (ms: number) =>
new Promise<void>(resolve => {
setTimeout(resolve, ms);
});
function ApprovalDemo() {
const [picked, setPicked] = useState<string>();
// Firm Pilot takes a moment to apply the pick; the button spins, then ticks.
const select = async (value: string) => {
await wait(900);
setPicked(value);
};
return (
<div className="flex flex-wrap items-start gap-4">
<PilotApprovalCard
title="Update Jane Citizen"
details={details}
options={options}
onSelect={select}
readOnly={picked !== undefined}
selectedValue={picked}
/>
<PilotApprovalCard
title="Update Jane Citizen"
details={details}
options={options}
onSelect={() => undefined}
readOnly
/>
</div>
);
}
type Step = "running" | "done" | "failed";
function SettlingDemo() {
const [search, setSearch] = useState<Step>("done");
const [write, setWrite] = useState<Step>("failed");
const run = () => {
setSearch("running");
setWrite("running");
setTimeout(() => setSearch("done"), 1400);
setTimeout(() => setWrite("failed"), 2000);
};
return (
<div className="flex flex-col items-start gap-3">
<div className="flex flex-col">
<PilotToolCall
title={
search === "running" ? "Searching contacts" : "Searched contacts"
}
icon={<Search />}
state={search}
duration={search === "running" ? undefined : 1.4}
/>
<PilotToolCall
title={
write === "running"
? "Reading the costs agreement"
: "Couldn't read the costs agreement"
}
icon={<FileText />}
state={write}
duration={write === "running" ? undefined : 2}
/>
</div>
<Button intent="outline" size="sm" onClick={run}>
Run again
</Button>
</div>
);
}Keyboard
The keys it answers to. Tab moves between components, arrows move within them.
| Keys | What they do |
|---|---|
| EnterSpace | Toggle the focused section and keep focus on its trigger. |
| Tab | Moves from an open trigger into its panel, and skips a closed one. |





