Scan your whole stack
Are you using @reinsjs/adapter-tanstack-ai?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.5.2
@reinsjs/adapter-tanstack-ai was last scanned on 24 Nov 2026 at version 0.5.2. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.5.2 LATEST | 24 Nov 2026 | No rules fired |
| 0.5.1 | 24 Nov 2026 | No rules fired |
| 0.5.0 | 23 Nov 2026 | No rules fired |
| 0.4.1 | 19 Nov 2026 | Not shown |
| 0.3.10 | 8 Nov 2026 | Not shown |
Findings for v0.5.2. 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.5.2; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Run the reins brain inside TanStack AI's chat() as a middleware. TanStack drives the loop, executes tools and handles interrupts; reins keeps the event log as the single source of truth, projects it into what the model sees on every turn, and runs its brain modules (compaction, pins, spill, memory, approval, budget, perception) on TanStack's hooks.
pnpm add @reinsjs/adapter-tanstack-ai @tanstack/ai@0.53.0
import { reinsApprovalInterrupt, reinsMiddleware } from "@reinsjs/adapter-tanstack-ai"
import { approval, compact, perception, spill } from "@reinsjs/brain"
import { chat } from "@tanstack/ai"
const stream = chat({
adapter,
messages,
tools,
systemPrompts: ["You are…"],
middleware: [
reinsMiddleware({
sessionId,
log: store.log,
blobs: store.blobs,
sockets: [perception(), compact(), spill(), approval({ ask: ["deploy"] })],
capabilities: { contextWindow: 200_000 }, // TanStack does not tell middleware how big the window is
}),
],
interrupts: [reinsApprovalInterrupt], // required: dynamic approvals are a generic interrupt
})
onConfig(init) reads the log (fail-closed on unknown events), merges the brain's static tools and prompt fragment, and imports the client's new user messages. Import is idempotent: a network retry that re-sends the same request does not write the message twice (key = message id if present, else its position in the client array, plus exact content).onConfig(beforeModel) replaces providerMessages with the projection of the log — TanStack's own messages array only serves the UI.onChunk / onUsage append the model's blocks and a budget_usage event.onInterruptBoundary(beforeTools) runs the socket pipeline for every pending call; a defer becomes a reinsApprovalInterrupt so the run pauses and the client resumes it with resume. onInterruptResolution records the answer as approval_decision.onAfterToolCall / onToolPhaseComplete append results, including the ones TanStack handled itself (native needsApproval, client-side tools).reinsApprovalInterrupt is missing from chat({ interrupts }), the type layer complains; at run time the middleware also checks the engine's registry, warns once, and treats every call that would need approval as denied (an approval_decision with by: "reins" is left in the log) instead of letting the engine throw mid-run.defer pauses the whole tool batch, not just the call that needs approval — that is where TanStack's boundary sits.system role. system_note events travel as a framed user message and are declared lossy; thinking is replayed only with a same-provider signature. The complete table is TANSTACK_LOSS_MATRIX.asTool) is not available here. A tool returning subagentPause is reported to the model as an error; the child session stays paused and can be resumed by the host.durationSec is not exported and imported clips have none (the estimate falls back to byte size). URL sources, documents and parts whose mime type does not match their kind become a placeholder and are reported in dropped. Whether the provider takes video or audio is up to TanStack's provider adapter, not reins.@tanstack/ai is pinned to an exact version because the middleware relies on hook contracts read from its source.capabilities.deferredTools is always false on this path, even if you pass true: TanStack's adapter decides how tools reach the provider, so there is no place for defer_loading / tool_reference, and BeforeModelPatch.deferredTools is not read. lazyTools() therefore always takes its filtering path here; the cache-preserving native path is runLoop + @reinsjs/lowering-fetch on Anthropic.approval({ ttlMs }) works here exactly as in the default loop: TanStack re-enters the beforeTools boundary after an interrupt is resolved, so the beforeTool pipeline runs again and an approval that arrived too late is denied with approval_decision(by: "approval.expired") before the tool runs (middleware.test.ts, "审批").ctx.batch is filled, but the engine checks a whole batch in beforeTools before running any of it, so beforeTool sees no results from the same batch (only those of a resumed batch logged by an earlier run) and held stays empty — a defer pauses the whole batch anyway. haltOnFailure() therefore never holds back calls of a fresh batch here. A resumed batch also gets no onTurnEnd: after the leftover calls run, the engine asks the model straight away, so stopAfter() cannot end a run on a wrap-up call that waited behind an approval (middleware.test.ts, "TurnContext.batch").docs/系统全景图_模块盘点/adapter-tanstack-ai.md and docs/archive/implementation-plans/2026-09-08-技术方案v1.0.md §2 / §11 — in Chinese, at the repository root.
MIT © 2026 NewRate Limited.
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.