{"name":"tool-chips","title":"Tool Chips","description":"","kind":"block","category":"agent","status":"beta","props":{"steps":{"type":"array","items":{"key":"string? (defaults to label)","icon":"'think' | 'write' | 'run' | 'read' | 'image' | 'search' | icon component","label":"string","chip":"string","mono":"boolean?","detailMono":"boolean?","detail":"{ text: string; tone?: 'add' }[]"},"description":"Tool calls in order. A step appended later enters without a stagger delay."},"diffs":{"type":"array","items":{"file":"string","add":"number","del":"number","lines":"{ text: string; tone?: 'add' | 'del' | 'ctx' }[]? (the hover-card preview)"},"description":"Changed files. Each chip opens a hover-card with the file name, the counts and the preview lines."},"open":{"type":"boolean","default":true,"part":"run","model":true,"description":"The run is expanded."},"openRows":{"type":"array","model":true,"description":"Keys (step.key ?? step.label) of expanded steps; data-state=open on each step's collapsible."},"labels":{"type":"object","description":"{ header, more }. header defaults to '<n> tool calls' ('1 tool call'); more is hidden unless set."},"appear":{"type":"boolean","default":false,"description":"Whether the steps and the diff row present at mount enter, staggered. Off by default: set it on the run your code adds live, never on one rendered from history or with the page (a mount is not an arrival). Steps and diffs added after mount enter either way."}},"playground":{"name":"Playground","props":{"open":true,"openRows":[],"steps":[{"icon":"read","label":"Read file","chip":"src/booking/slots.ts","mono":true,"detail":[{"text":"212 lines · exports buildSlots, mergeSlots"}]},{"icon":"write","label":"Edit 6 lines","chip":"src/booking/slots.ts","mono":true,"detailMono":true,"detail":[{"text":"- const end = addMinutes(start, service.length)"},{"text":"+ const end = addMinutes(start, service.length, { tz: location.timeZone })","tone":"add"}]},{"icon":"run","label":"Run tests","chip":"pnpm test slots","mono":true,"detailMono":true,"detail":[{"text":"✓ slots.test.ts (19 tests) 1.4s"},{"text":"✓ 19 passed"}]}],"diffs":[{"file":"slots.ts","add":4,"del":2,"lines":[{"text":"export function buildSlots(start: Date, service: Service) {","tone":"ctx"},{"text":"  const end = addMinutes(start, service.length);","tone":"del"},{"text":"  const end = addMinutes(start, service.length, {","tone":"add"},{"text":"    tz: location.timeZone,","tone":"add"},{"text":"  });","tone":"add"}]},{"file":"slots.test.ts","add":18,"del":0,"lines":[{"text":"it(\"keeps a 9:00 slot at 9:00 across the DST change\", () => {","tone":"add"},{"text":"  const slots = buildSlots(new Date(\"2026-03-29T09:00\"), haircut);","tone":"add"},{"text":"  expect(slots[0].start).toBe(\"09:00\");","tone":"add"},{"text":"});","tone":"add"}]}]}},"exampleFiles":[{"file":"default","title":"Agent fixed a failing booking test"},{"file":"agent-working","title":"Agent still working on a fix"},{"file":"refactor-run","title":"Review a finished refactor, step by step"},{"file":"folded","title":"Earlier run, folded in the chat"}],"worstCase":[{"name":"40 long steps","props":{"labels":{"header":"40 tool calls, 12,480 messages","more":"+12,438 more"},"steps":[{"icon":"think","label":"Reconcile invoice batch 01 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-01/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 312 of 312 line items in batch 01 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 02 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-02/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 624 of 624 line items in batch 02 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 03 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-03/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 936 of 936 line items in batch 03 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 04 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-04/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 1,248 of 1,248 line items in batch 04 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 05 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-05/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 1,560 of 1,560 line items in batch 05 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 06 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-06/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 1,872 of 1,872 line items in batch 06 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 07 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-07/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 2,184 of 2,184 line items in batch 07 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 08 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-08/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 2,496 of 2,496 line items in batch 08 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 09 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-09/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 2,808 of 2,808 line items in batch 09 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 10 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-10/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 3,120 of 3,120 line items in batch 10 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 11 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-11/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 3,432 of 3,432 line items in batch 11 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 12 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-12/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 3,744 of 3,744 line items in batch 12 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 13 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-13/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 4,056 of 4,056 line items in batch 13 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 14 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-14/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 4,368 of 4,368 line items in batch 14 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 15 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-15/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 4,680 of 4,680 line items in batch 15 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 16 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-16/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 4,992 of 4,992 line items in batch 16 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 17 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-17/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 5,304 of 5,304 line items in batch 17 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 18 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-18/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 5,616 of 5,616 line items in batch 18 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 19 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-19/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 5,928 of 5,928 line items in batch 19 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 20 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-20/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 6,240 of 6,240 line items in batch 20 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 21 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-21/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 6,552 of 6,552 line items in batch 21 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 22 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-22/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 6,864 of 6,864 line items in batch 22 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 23 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-23/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 7,176 of 7,176 line items in batch 23 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 24 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-24/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 7,488 of 7,488 line items in batch 24 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 25 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-25/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 7,800 of 7,800 line items in batch 25 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 26 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-26/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 8,112 of 8,112 line items in batch 26 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 27 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-27/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 8,424 of 8,424 line items in batch 27 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 28 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-28/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 8,736 of 8,736 line items in batch 28 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 29 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-29/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 9,048 of 9,048 line items in batch 29 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 30 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-30/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 9,360 of 9,360 line items in batch 30 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 31 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-31/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 9,672 of 9,672 line items in batch 31 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 32 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-32/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 9,984 of 9,984 line items in batch 32 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 33 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-33/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 10,296 of 10,296 line items in batch 33 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 34 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-34/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 10,608 of 10,608 line items in batch 34 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 35 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-35/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 10,920 of 10,920 line items in batch 35 without a single tolerance override","tone":"add"}]},{"icon":"think","label":"Reconcile invoice batch 36 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-36/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 11,232 of 11,232 line items in batch 36 without a single tolerance override","tone":"add"}]},{"icon":"write","label":"Reconcile invoice batch 37 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-37/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 11,544 of 11,544 line items in batch 37 without a single tolerance override","tone":"add"}]},{"icon":"run","label":"Reconcile invoice batch 38 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-38/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 11,856 of 11,856 line items in batch 38 without a single tolerance override","tone":"add"}]},{"icon":"read","label":"Reconcile invoice batch 39 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-39/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 12,168 of 12,168 line items in batch 39 without a single tolerance override","tone":"add"}]},{"icon":"search","label":"Reconcile invoice batch 40 of 40 against the purchase-order ledger","chip":"src/finance/reconciliation/northwind-industries-holdings/emea/batches/batch-40/ledger-entries.normalized.json","mono":true,"detailMono":true,"detail":[{"text":"+ matched 12,480 of 12,480 line items in batch 40 without a single tolerance override","tone":"add"}]}],"diffs":[{"file":"src/finance/reconciliation/northwind-industries-holdings/emea/ledger.normalized.ts","add":12480,"del":9999},{"file":"a.ts","add":1,"del":0}]}},{"name":"No steps","props":{"labels":{"header":"0 tool calls"},"steps":[],"diffs":[]}},{"name":"One long word","props":{"openRows":["Read"],"steps":[{"icon":"read","label":"Read","chip":"Supercalifragilisticexpialidociousconfigurationloaderfactoryprovider.ts","mono":true,"detailMono":true,"detail":[{"text":"Supercalifragilisticexpialidociousconfigurationloaderfactoryproviderimplementation"}]}],"diffs":[{"file":"Supercalifragilisticexpialidociousconfigurationloaderfactoryprovider.ts","add":1,"del":1}]}},{"name":"Right-to-left","props":{"openRows":["كتابة 204 أسطر"],"labels":{"header":"4 استدعاءات أدوات"},"steps":[{"icon":"think","label":"تفكير","chip":"تخطيط جدول الإنتاج…","detail":[{"text":"الطلب في نهاية الشهر يرفع الخطط السنوية."}]},{"icon":"write","label":"كتابة 204 أسطر","chip":"InvoiceSchedule.tsx","mono":true,"detailMono":true,"detail":[{"text":"+ const windows = slots.filter(idle)","tone":"add"}]}],"diffs":[{"file":"invoices.css","add":13,"del":0}]}}],"anatomy":[{"part":"root","element":"div","description":"max-width 320"},{"part":"run","element":"div","description":"A collapsible (variant inline, caret start) on the run: its trigger is the header ('4 tool calls'), its region holds the rows and the diff chips. The engine sets aria-expanded, aria-controls and data-state; a closed run stays laid out at 0 rows (invisible, out of the tab order) so the steps do not replay their entrance when it reopens"},{"part":"rows","element":"div"},{"part":"step","element":"div","repeat":true,"description":"One tool call: a collapsible (variant inline, caret start). --fndn-row-index (set only on steps present at mount) staggers its entrance"},{"part":"icon","element":"span","description":"The tool glyph, laid over the trigger's caret; they crossfade on hover (gated), focus-visible and open. aria-hidden"},{"part":"label","element":"span","description":"Truncates; full text in title"},{"part":"value","element":"span","description":"Field chip with the tool's argument; data-mono; truncates, full text in title"},{"part":"lines","element":"div","description":"The step's detail inside its collapsible region; hairline on the inline-start side; data-mono"},{"part":"line","element":"span","repeat":true,"description":"data-tone=add → green; truncates, full text in title"},{"part":"diffs","element":"div","optional":true,"description":"Hairline top border; enters as one beat after the steps"},{"part":"diff","element":"button","repeat":true,"description":"File chip: a hover-card trigger (the hover-card's mono chip) whose card shows the file's diff on hover or keyboard focus; click fires diffClick"},{"part":"add","element":"span","optional":true},{"part":"del","element":"span","optional":true},{"part":"file","element":"span","description":"One changed file: holds its hover-card (no box of its own). The last one also holds the more button, so the two share a line and the chip's file name truncates before the button would wrap alone","repeat":true},{"part":"more","element":"button","optional":true,"description":"Shown when labels.more is set"}],"events":{"openChange":"(open: boolean)","openRowsChange":"(keys: string[]) (Vue/Svelte through v-model:openRows / bind:openRows)","toggleRow":"(label: string, open: boolean)","diffClick":"(file: string)","moreClick":"()"},"states":["open","closed","row-hover","row-press","row-focus-visible","row-open","chip-hover","chip-focus-visible","chip-press"],"tokens":["color.ink","color.ink-2","color.ink-3","color.field","color.hover","color.hover-2","color.line","color.green","color.red","shadow.hairline","radius.control","radius.chip","font.mono","easing.out-strong","duration.fast","duration.press","duration.move","duration.enter","duration.stagger","motion.stagger-max","motion.press-scale"],"a11y":{"keyboard":["Tab reaches the run header, then every step row, then the diff chips; collapsed content is out of the tab order","Enter / Space on the header expand or collapse the run; focus stays on the header; the change is instant","Enter / Space on a step row expand or collapse its detail; focus stays on the row; the change is instant","Focusing a diff chip opens its diff card (hover-card); Escape or moving focus closes it; Enter / Space fire diffClick"],"notes":["The header and every row are collapsible triggers: real buttons with aria-expanded and aria-controls pointing at the region they reveal.","Icons and the glyph/caret slot are aria-hidden.","Truncated labels, values, detail lines and file names carry the full text in title."]},"motion":["mount: nothing plays unless appear is set; with appear, steps present at first render fade up over duration.enter (easing.out-strong, fill both), staggered by duration.stagger and capped at motion.stagger-max; the diff row enters as one more beat. A step that arrives later enters with no delay and opens its room as it fades (its row track minmax(0,0fr) → minmax(0,1fr) over duration.reveal, easing.out-strong, from @starting-style; the adapter sets --fndn-row-room: 0fr on an arriving step only, so steps present at first render do not move), so the diffs below slide down instead of jumping","run and row expand / collapse: the collapsible's reveal recipe; the rows below move with the region; nothing inside enters again; instant from the keyboard","caret: the collapsible's right caret turns down over duration.move (easing.out-strong); on a step row it crossfades with the tool glyph over duration.fast on hover (gated), focus-visible and open","press: the header and rows take the collapsible's press (--fndn-hover-2); diff chips (the hover-card trigger) and the more button scale to motion.press-scale over duration.press","diff card: the hover-card's popup recipe; instant when opened by keyboard focus"]}