Coming soon
@beliefs/react is in development. This page describes the planned API.
What It Provides
React hooks for reading belief state in your components. Subscribe to claims, track clarity, and display confidence, with real-time updates as beliefs change.
Planned Hooks
useBeliefs
Returns the current belief snapshot. Auto-updates when beliefs change.
1function Dashboard() {
2 const { claims, gaps, clarity } = useBeliefs()
3
4 return (
5 <div>
6 <p>Clarity: {(clarity * 100).toFixed(0)}%</p>
7 <p>{claims.length} claims, {gaps.length} gaps</p>
8 </div>
9 )
10}useClaim
Subscribe to a specific claim by ID. Returns confidence, evidence count, and last updated timestamp.
1function ClaimBadge({ claimId }: { claimId: string }) {
2 const { text, confidence, evidenceCount } = useClaim(claimId)
3
4 return (
5 <span title={`${evidenceCount} evidence sources`}>
6 {text} - {(confidence * 100).toFixed(0)}%
7 </span>
8 )
9}useClarity
Returns the current clarity score and its components.
1function ClarityIndicator() {
2 const { score, readiness } = useClarity()
3
4 return (
5 <div>
6 <span>Clarity: {(score * 100).toFixed(0)}%</span>
7 <span>Readiness: {readiness}</span>
8 </div>
9 )
10}Request Early Access
If you are building a belief-aware UI and want early access to the React hooks, request access.