Back to Lobehub

Tool UI Surfaces

.agents/skills/builtin-tool/references/ui/README.md

2.2.23.2 KB
Original Source

Tool UI Surfaces

A builtin tool can ship up to six client-side surfaces, each with a different role in the chat UI. Only Inspector is required; the other five are added on demand and registered in their own central files.

SurfaceRequired?When the chat shows itRegistered in
Inspector✅ AlwaysHeader strip of every tool call (one-line chip)packages/builtin-tools/src/inspectors.ts
RenderOptionalRich result card below the header, after the call returnspackages/builtin-tools/src/renders.ts
PlaceholderOptionalSkeleton between "args streaming complete" and "result arrives"packages/builtin-tools/src/placeholders.ts
StreamingOptionalLive output during execution (e.g. command stdout)packages/builtin-tools/src/streamings.ts
InterventionOptionalApproval / edit-before-run dialog (when humanIntervention triggers)packages/builtin-tools/src/interventions.ts
PortalOptionalFull-screen detail view (right-side or modal)packages/builtin-tools/src/portals.ts

The two reference tools to read end-to-end:

  • builtin-tool-web-browsing/src/client/ — Inspector + Render + Placeholder + Portal (no Intervention/Streaming).
  • builtin-tool-local-system/src/client/ — all six surfaces, including components/ for shared building blocks.

Files in this folder

Read principles and shared-rules first — they apply to every surface. Then jump to the surface you're building.

FileWhat it covers
principles.mdDesign principles — when each surface exists and how far to take it
shared-rules.mdCross-surface rules: component skeleton, styling, single-layer surfaces
inspector.mdInspector — header chip (required)
render.mdRender — rich result card
placeholder.mdPlaceholder — skeleton between args and result
streaming.mdStreaming — live output during execution
intervention.mdIntervention — approval / edit-before-run
portal.mdPortal — full-screen detail view
composition.mdShared subcomponents (client/components/) + package public API
diagnostics.mdSymptom → surface quick-lookup