@aaronhan717/agent-rtb-client
v0.1.0
Published
React + Tailwind component for agent-rtb: decisions, tasks, standups, business memory
Readme
@aaronhan717/agent-rtb-client
React component for agent-rtb — the cofounders' brief, decision/task timeline, proposal review, insights, meeting journal, and search. Design: docs/superpowers/specs/2026-08-29-agent-rtb-design.md; server: packages/rtb-server.
Mount
import { AgentRTB } from '@aaronhan717/agent-rtb-client';
<AgentRTB baseUrl="/api/rtb" /> // theme follows prefers-color-scheme
<AgentRTB baseUrl="/api/rtb" theme="dark" /> // forced| Prop | Default | Meaning |
|---|---|---|
| baseUrl | — | the console's proxy to the agent-rtb service (/api/rtb → https://agent-rtb-….run.app) |
| headers | — | extra headers on every request; the proxy normally adds Authorization: Bearer … and X-Actor: encodeURIComponent(displayName) itself |
| theme | system | light / dark / system |
| pollMs | 30000 | brief polling interval while a standup is open (paused while the tab is hidden) |
The proxy must forward Authorization and X-Actor (percent-encoded — header values cannot carry Chinese raw) and strip the /api/rtb prefix; the service has no path prefix.
Styling is Tailwind utility classes: add the package's dist to the host's Tailwind sources (@source "../node_modules/@aaronhan717/agent-rtb-client/dist"; in v4, or the content glob in v3). Verified against Tailwind 4 (the playground's version); v3.1+ should compile the same arbitrary-value classes but is unverified. Colors are CSS variables the component injects itself (--rtb-*), so no host configuration beyond the source line. No web fonts are loaded; the component uses the system CJK stack.
Develop
npm run dev:rtb-stack from the repo root starts mongod, a fake LLM, the server against the seeded agent-rtb-e2e database, and the playground at http://localhost:5182/rtb.html (?actor=阿伟 to act as another cofounder, ?theme=dark). FAKE_LLM_DELAY_MS=4000 slows extraction to see the progress state; FAKE_LLM_FAIL=1 exercises the failure path.
Test
npm test # node:test via tsx — pure modules, the API client against a stub fetch, every panel rendered to static markup
npm run typecheck
npm run build # tsc → dist/ (ESM + d.ts)The browser pass is agentic: packages/skill/rtb-test-e2e/SKILL.md (Playwright MCP + MongoDB MCP) over open → dispose → close → upload → extract → accept.
Layout
src/AgentRTB.tsx (root: context, top bar, drawer stack, toasts, brief polling) · api.ts (typed client, ApiError) · types.ts (server mirrors) · zh.ts (every string; errorText(code)) · dates.ts (business-tz calendar) · theme.ts · transitions.ts (client mirror of allowed task transitions) · hooks/usePagedList.ts (the paged-list container hook shared by 审核/洞察/日志) · ui/ (atoms, TaskRow) · forms/ · drawers/ · views/ — each view is a fetching XView around a pure XPanel.
