mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
bb514482a2a686ea18617e7f258e2721ac92b900
Use the cached message converter from @assistant-ui/react to prevent re-converting all messages on every render. The previous implementation called convertMessage for every ChatBlock on each render cycle, creating new objects (Date, arrays, metadata) that triggered unnecessary state updates and re-render storms. The new implementation: - Uses useExternalMessageConverter which internally caches via WeakMap - Memoizes callbacks with useCallback for stable references - Memoizes the adapter object to prevent subscription churn
hapi
Monorepo with three Bun workspace packages:
cli/(hapi): CLI (npm package) exposinghapi/hapi-mcpserver/(hapi-server): backend API + Telegram bot server, servesweb/dist/web/(hapi-web): web frontend (Vite) building toweb/dist/
Commands
Run from the repo root:
bun install
bun run typecheck
bun run build
Languages
TypeScript
99.5%
CSS
0.2%
JavaScript
0.2%
HTML
0.1%