Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

1.9 KB
Raw Blame

Composition β€” Shared Components & Package API

client/components/ β€” Shared Subcomponents

Cross-cutting building blocks used by multiple surfaces live here, not duplicated in each surface folder.

Examples from web-browsing/src/client/components/:

  • CategoryAvatar.tsx β€” search category icon
  • EngineAvatar.tsx β€” search engine logo (used in Inspector chip + Render list + Portal header)
  • SearchBar.tsx β€” editable query bar (used in Render and Portal)

Examples from local-system/src/client/components/:

  • FileItem.tsx β€” single file row (used in ListFiles Render, SearchFiles Render, MoveLocalFiles Render)
  • FilePathDisplay.tsx β€” path with truncation (used everywhere)

Rules

  • Live under client/components/, exported via client/components/index.ts.
  • Re-export from client/index.ts only if other packages need them; otherwise keep internal.
  • Keep them dumb β€” props in, JSX out, no store reads. The store reads belong in the surface that composes them.

client/index.ts β€” Package Public API

Re-exports everything the registries need plus useful types/manifest:

// Inspector β€” required
export { TaskInspectors } from './Inspector';

// Render β€” only if any API has one
export { TaskRenders, CreateTaskRender, RunTasksRender } from './Render';

// Placeholder / Streaming / Intervention β€” only if used
export { LocalSystemListFilesPlaceholder, LocalSystemSearchFilesPlaceholder } from './Placeholder';
export { LocalSystemStreamings } from './Streaming';
export { LocalSystemInterventions } from './Intervention';

// Portal β€” single export per tool
export { default as WebBrowsingPortal } from './Portal';

// Reusable components if other packages need them
export { CategoryAvatar, EngineAvatar, SearchBar } from './components';

// Re-export manifest, identifier, types for convenience
export { TaskManifest, TaskIdentifier } from '../manifest';
export * from '../types';