Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@theoremjs/react

Latest version: v0.3.5-next.1034.gfe14d6a

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: masudl-hub
0 Stars
0 Forks
248 Versions
34.4K Downloads
TypeScript Repo language

Scan summary

@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.

  • Releases: 248 versions; the latest 5 were published within 2 days (28 and 29 Nov 2026).
  • Findings: No rules fired in version 0.3.5-next.1034.gfe14d6a.
  • Downloads: 34,405 downloads.

Versions

248 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 0.3.5-next.1034.gfe14d6a

Findings

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.

README

The publisher’s own README, as collected from the registry.

@theoremjs/react

npm CI MIT License

Define an agent once. Get the server and the user interface from the same definition.

The idea

In Theorem, you write an agent as a profile (see @theoremjs/agents). The profile states:

  • which models the agent can use
  • what the agent accepts: text, images, files, or voice
  • which tools the agent can call
  • what the agent must return
  • how the kernel guards each input and output

This package uses the same profile on both sides.

  • Server. createTheoremHandler runs the profile. It enforces the guardrails and the tool gates, and it keeps the conversation.
  • Browser. The UI asks the server to describe the profile. It then shows what the profile allows. It shows no attachment button if the profile does not accept files. It shows a model picker if the profile lets the user choose the model.
                  ┌─────────────────────────────┐
                  │        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:

  • A ready-made chat, voice call, host console, and decision form. They are built on Astryx.
  • Hooks and a transport, for your own UI.
  • The server handler and the client of @theoremjs/web, as /server and /client.

Install

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:

  • TypeScript 5.7 or later, for the type declarations.
  • A bundler that handles CSS imports. Vite does. /ui and /live import their own stylesheets.
  • For voice, a bundler that resolves 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.

Quick start

1. Register the provider and create the handler

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.

2. Mount the handler

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 });
  },
};
3. Show the chat
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.

Entry points

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.

Chat

<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.
Resume a conversation

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:

  • when the message reaches the server
  • each time the server saves the reply, while the reply runs and when it ends
  • with 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.

Send a message from your code

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} />

OX Radar and Response Center

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.

Where it’s listed

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).

  • npm @theoremjs/react

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229