Scan your whole stack
From OX Research Newsroom
Are you using @theoremjs/react?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.3.5-next.1034.gfe14d6a
@theoremjs/react was last scanned on 29 Nov 2026 at version 0.3.5-next.1034.gfe14d6a. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.3.5-next.1034.gfe14d6a LATEST | 29 Nov 2026 | No rules fired |
| 0.3.5-next.1033.g5c598ea | 29 Nov 2026 | No rules fired |
| 0.3.5-next.1032.g04dc504 | 29 Nov 2026 | No rules fired |
| 0.3.5-next.1031.g1faef7b | 29 Nov 2026 | Not shown |
| 0.3.5-next.1030.g3b5fcaa | 28 Nov 2026 | Not shown |
Findings for v0.3.5-next.1034.gfe14d6a. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.3.5-next.1034.gfe14d6a; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Define an agent once. Get the server and the user interface from the same definition.
In Theorem, you write an agent as a profile (see @theoremjs/agents). The profile states:
This package uses the same profile on both sides.
createTheoremHandler runs the profile. It enforces the guardrails and the tool gates, and it keeps the conversation. ┌─────────────────────────────┐
│ agent profile │
│ models · inputs · tools │
│ output · guardrails │
└──────────────┬──────────────┘
│
┌────────────────┴────────────────┐
▼ ▼
┌───────────────────────────────┐ ┌───────────────────────────────┐
│ SERVER │ │ BROWSER │
│ createTheoremHandler │ │ <TheoremChat /> │
│ │ │ useTheoremInterface() │
│ runs the profile │ │ shows only what the │
│ enforces guardrails and gates │ │ profile allows │
└───────────────┬───────────────┘ └───────────────┬───────────────┘
└─ HTTP: describe · turn · steer ─┘
Edit the profile, and both sides change. You do not write the UI code again.
When a profile records traces, the chat offers a floating trace toggle. Opening the trace uses the same toggle to close it, with a selected appearance. When the trace replaces the chat, its pane has equal padding on all sides.
The package has three parts:
@theoremjs/web, as /server and /client.npm install @theoremjs/react @theoremjs/web @theoremjs/agents zod react react-dom
For the ready-made UI (/ui and /live), also install Astryx and StyleX:
npm install @astryxdesign/core @stylexjs/stylex
To build your own theme from the Theorem theme (/ui/theme), also install @astryxdesign/theme-neutral.
Use the versions that this package lists in peerDependencies. Install @theoremjs/react, @theoremjs/web, and @theoremjs/agents at the same version. The Astryx and StyleX peers are optional. The hooks work without them.
When a chat turn, a call, a host request, or a decision fails, the ready-made UI shows the error in a banner that screen readers announce at once. The end of a live call is announced when the reader is next idle.
Requirements:
/ui and /live import their own stylesheets.new URL('./worklets/mic-capture.js', import.meta.url). Vite does.The package does not include the Figtree font. The theme uses Figtree, and falls back to the system font if Figtree is not loaded. To use Figtree, load the font in your app.
Register the provider before you create the handler. The profile binds models through the registered provider's .model() helper.
The helper takes the protocol and the model ID. Pass credential values through the handler's vault.
Supply vault slots as own properties. The server ignores inherited credentials and resolvers.
Replacing the registration affects later runs. An active run keeps the registration that it started with.
import { defineProfile, geminiProvider, registerProvider } from '@theoremjs/agents';
import { createMemoryConversationStore, createTheoremHandler } from '@theoremjs/web/server';
const gemini = registerProvider(geminiProvider, { keySlot: 'main' });
const support = defineProfile({
type: 'text',
id: 'support.agent',
identity: { handle: 'support', system: 'You help customers with their account.' },
models: {
fast: gemini.model('geminiInteractions', 'gemini-3.5-flash-lite'),
},
defaultModel: 'fast',
tools: { allow: [] },
inputs: { text: true },
});
export const theorem = createTheoremHandler({
profile: support,
provider: { vault: { main: process.env.GEMINI_API_KEY } },
conversationStore: createMemoryConversationStore(),
});
The memory store keeps each conversation in process memory. For other stores, see Keep the conversation.
createTheoremHandler returns a function: (request: Request) => Promise<Response>. It works in Workers, Deno, Bun, Hono, and Next route handlers. In Node, use an adapter.
Send all requests under one path to the handler. The default path is /api/theorem.
export default {
fetch(request: Request) {
return new URL(request.url).pathname.startsWith('/api/theorem')
? theorem(request)
: new Response('Not found', { status: 404 });
},
};
import { TheoremChat } from '@theoremjs/react/ui';
export function App() {
return <TheoremChat endpoint="/api/theorem" />;
}
The profile, the keys, and the system prompt stay on the server. The browser receives only the interface of the profile: the models, the inputs, the tool names, and the wording. The handler removes the system prompt from this description.
| Import | Content |
|---|---|
@theoremjs/react |
Hooks, transports, and client logic |
@theoremjs/react/ui |
TheoremChat, TheoremHost, TheoremDecision, TheoremEmbedding, and their parts |
@theoremjs/react/live |
useLiveCall, LiveRunner and LiveCallTile, the voice and video call and its UI |
@theoremjs/react/server |
@theoremjs/web/server: the handlers and the stores they use |
@theoremjs/react/ui/theme |
theoremTheme, the base for your own Astryx theme |
@theoremjs/react/ui/icons |
The icon set of the theme |
@theoremjs/react/client |
@theoremjs/web/client: the client logic, without the hooks |
To draw your own figures like the trace panel does, @theoremjs/react/ui also exports its chart parts. ChartCard holds a chart under its name and one figure. ChartStat is one figure in a card. RankedBars draws one bar per RankedBar, in the order given, with a TraceFill for each. RadialBars draws the same rows as rings. Sunburst draws SunburstNode parts as rings, each child outside its parent.
<TheoremChat /> accepts these props. All props are optional.
| Prop | Use |
|---|---|
endpoint |
The path where the handler is mounted. Default: /api/theorem. |
http |
Fetch options for the default transport, such as auth headers or a custom fetch. |
transport |
Your own transport, instead of endpoint. Use it for tests or for hosts that do not use HTTP. |
theme, mode |
An Astryx theme, and 'system', 'light', or 'dark'. Without theme, the chat uses your theme or the Theorem theme. |
labels |
Replacement text for each locale. See Wording. |
placeholder, emptyState |
The composer placeholder, and the content above the composer before the first message. |
density, maxWidth, className, style |
Layout. maxWidth is a CSS length. Default: half of the chat width, or the full width on a narrow screen. |
trace |
Shows the trace instead of the chat. Use it when your own control switches the view. The profile must record traces. |
conversation, conversationView, onConversationChange |
Resume a conversation that the server keeps, or open one you started. See below. |
initialText |
The text that the composer starts with. The user can send it or change it. The component reads it once, when it mounts. |
initialFiles |
The files that the composer starts with, staged to send. The component reads them once, when it mounts. |
initialVoice |
The voice notes that the composer starts with, staged to send. The component reads them once, when it mounts. |
initialPending |
The messages that the composer starts with set aside: queued, stashed, or steering, as createComposerPendingMessage from @theoremjs/agents/interface makes them. The component reads them once, when it mounts. |
chatRef |
Sends a message, stops a reply, or focuses the composer from your code. See below. |
composer |
false leaves the composer out. The chat is the transcript alone, and your own control sends through chatRef. Default: true. |
The server keeps the conversation in its conversationStore. The browser never sends the history. It holds only a ref that the store issued.
onConversationChange gives you each new ref. It runs:
undefined when the server can no longer open the ref you resumed. The chat starts a new conversation with no error, so forget the ref.Keep the latest ref. To resume the conversation, pass it as conversation. The component reads this value once, when it mounts. It then draws the conversation as the server keeps it, including a reply that waits for a gate.
<TheoremChat
endpoint="/api/theorem"
conversation={savedRef}
onConversationChange={(ref) => (ref ? saveRef(ref) : forgetRef())}
/>
If the server does not save the message, the message leaves the transcript. It goes back in the composer with the error, and the user can send it again.
If the browser loses the response to a gate answer, the chat reads the conversation again from the server. The same answer sent again fails with session.gate_expired.
If the server can no longer open the ref, the message fails with session.conversation_unknown. The error's errorCopy carries that key. The chat then sends the message once more, with the transcript the page shows as transcript. createTheoremHandler ignores it, because the server owns the conversation, so the message fails. The studio's server owns no conversation of its own: it continues from the transcript under a new ref.
A profile whose providerContinuation.history is 'stateless' keeps no conversation. The server stores nothing and issues no ref. The transcript is kept only in the page, and a reload clears it.
chatRef gives you send(text, options?). It sends the text as the user. options can add files and voice, arrays of browser files, which use the same profile validation and encoding as composer attachments. It can also name a model and its effort for the turn. The model becomes the chat's pick, as if chosen in the composer. A model or file the profile does not take is refused, as the composer refuses it, and the refusal shows in the chat. When the reply is complete, it returns the blocks that the turn added. It returns null if the chat cannot accept a message now. This happens while a reply streams or waits for a gate.
chatRef also gives you stop(). It stops the reply that streams, as the composer's stop button does. It gives you focus(), which puts the keyboard in the composer, for example after your own control clears the chat. And it gives you controller, the chat's ChatController, for a host that drives the chat from outside, as a composer shared by several chats does.
const chat = useRef<TheoremChatHandle>(null);
const turn = await chat.current?.send('Summarize my open tickets');
<TheoremChat chatRef={chat} /> Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.