@vibro/react-helpers
v0.5.0-alpha.0
Published
Vibro React helpers: instrumentation hooks and a typed getVibro() runtime for React apps.
Readme
@vibro/react-helpers
Instrument your components; let the agent read the results.
React hooks that let an AI assistant question a running component from the outside — no
eval, no selector guessing. You add one line where the state lives; the agent picks the
answer up with a Vibro tool it already has.
pnpm add -D @vibro/react-helpersimport { useOnVibroRequest } from '@vibro/react-helpers';
useOnVibroRequest('cart_state', () => ({ items: items.length, total, coupon }));vibro request /cart_state
# → {"ok":true,"payload":{"items":3,"total":41.5,"coupon":null}}What's inside
useOnVibroRequest— answer a named request with whatever the component knows now.useVibroLogger— log under a topic, read it back withtail_logs/grep_logs.useVibroStoreValue— publish a page-scoped value forclient_store_get.useVibroServerStoreValue— publish a value on the dev server, surviving reloads.useVibro,useVibroConnection,getVibro— the raw API, bridge status, and an SSR-safe accessor outside React.
Without a dev client every hook is a no-op: react is a peer dependency, the Vibro
globals are defined away in production builds, and nothing is armed, buffered or timed.
Requirements
Requires a dev server running @vibro/bro,
React 18 or newer and Node.js >= 20. All @vibro/* packages are released as a
fixed-version group — use them at one and the same version.
License
Closed pre-release — see LICENSE. Installing the published package and running it unmodified, to evaluate it, is the whole of the grant. Redistribution, modification, reverse engineering and production or commercial use are not permitted.
