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

@johnhenry/aimatey-backend-browser

Latest version: v0.2.3

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: johnhenry
0 Stars
0 Forks
11 Versions
461 Downloads
TypeScript Repo language

Scan summary

@johnhenry/aimatey-backend-browser was last scanned on 25 Nov 2026 at version 0.2.3. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 11 versions; the latest was published on 25 Nov 2026.
  • Findings: No rules fired in version 0.2.3.
  • Downloads: 461 downloads.

Versions

11 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.3 LATEST 25 Nov 2026 No rules fired
0.2.2 31 Oct 2026 No rules fired
0.2.1 23 Oct 2026 No rules fired
0.1.7 23 Oct 2026 Not shown
0.1.6 7 Oct 2026 Not shown

No rules fired in 0.2.3

Findings

Findings for v0.2.3. 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.2.3; other versions have their own rules, not their own score.

README

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

@johnhenry/aimatey-backend-browser

npm version license

Note: Previously published as aimatey-backend.browser@0.5.1.

Browser-compatible backend adapters for Aimatey - Universal AI Adapter System.

Part of the aimatey monorepo.

Installation

npm install @johnhenry/aimatey-backend-browser

Overview

This package contains backend adapters that can run natively in browser environments without Node.js dependencies:

  • Chrome AI - Chrome's built-in on-device model via the Prompt API (LanguageModel)
  • Function - Custom function-based backends for testing and integration
  • Mock - Mock responses for testing and development

For server-side provider adapters (OpenAI, Anthropic, etc.), see @johnhenry/aimatey-backend.

Usage

Chrome AI Adapter

Runs entirely on-device via Chrome's built-in model — no API key, no network calls, no cost. Requires Chrome 138+ (the LanguageModel global; chrome://flags/#prompt-api-for-gemini-nano may be needed on some channels).

import { ChromeAIBackendAdapter } from '@johnhenry/aimatey-backend-browser';

const chromeAI = new ChromeAIBackendAdapter({ temperature: 0.7, topK: 40 });

// Tri-state availability - gate UI on 'downloadable' to show a download prompt
const availability = await chromeAI.checkAvailability(); // 'unavailable' | 'downloadable' | 'downloading' | 'available'

const response = await chromeAI.execute({
  messages: [{ role: 'user', content: 'Hello!' }],
  metadata: { requestId: 'req_1', timestamp: Date.now(), provenance: {} },
});

Structured output maps directly onto the Prompt API's responseConstraint:

const response = await chromeAI.execute({
  messages: [{ role: 'user', content: 'Extract the name and age from: John is 30.' }],
  responseFormat: {
    type: 'json_schema',
    schema: {
      type: 'object',
      properties: { name: { type: 'string' }, age: { type: 'number' } },
      required: ['name', 'age'],
    },
  },
  metadata: { requestId: 'req_2', timestamp: Date.now(), provenance: {} },
});
// response.metadata.custom.responseFormatEnforced === true

Notes:

  • Text-only for now (no image/audio input) - tools is not supported (surfaced as an IR warning if requested).
  • session.inputUsage/inputQuota (cumulative context-window tokens) are surfaced under response.metadata.custom, not response.usage - the Prompt API doesn't report a prompt/completion token split.
  • Pass onDownloadProgress in the config to receive download progress events while availability is 'downloadable'/'downloading'.
Function Backend
import { FunctionBackendAdapter, createFunctionBackend } from '@johnhenry/aimatey-backend-browser';

// Create a custom backend from a function
const customBackend = createFunctionBackend(async (request) => ({
  message: { role: 'assistant', content: 'Hello from custom backend!' },
  finishReason: 'stop',
  metadata: { requestId: request.metadata.requestId, provenance: {} },
}));
Mock Backend
import { MockBackendAdapter, createEchoBackend } from '@johnhenry/aimatey-backend-browser';

// Create a mock backend for testing
const mockBackend = new MockBackendAdapter({
  defaultResponse: 'This is a test response',
});

// Or use the echo helper
const echoBackend = createEchoBackend();

Subpath Imports

import { ChromeAIBackendAdapter } from '@johnhenry/aimatey-backend-browser/chrome-ai';
import { FunctionBackendAdapter } from '@johnhenry/aimatey-backend-browser/function';
import { MockBackendAdapter } from '@johnhenry/aimatey-backend-browser/mock';

API Reference

See the TypeScript definitions for detailed API documentation.

License

MIT - see LICENSE for details.

LiteRT-LM (on-device LLM, WebGPU)

Run Google's Gemma models entirely in the browser via LiteRT-LM — no API key, no server, no cost.

npm install @johnhenry/aimatey-backend-browser @litert-lm/core
import { Bridge } from '@johnhenry/aimatey-core';
import { OpenAIFrontendAdapter } from '@johnhenry/aimatey-frontend';
import { LiteRtLmBackendAdapter } from '@johnhenry/aimatey-backend-browser';

const backend = new LiteRtLmBackendAdapter({
  model:
    'https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it-web.litertlm',
  maxNumTokens: 8192,
});

const bridge = new Bridge(new OpenAIFrontendAdapter(), backend);

for await (const chunk of bridge.chatStream({
  model: 'gemma-4-E2B-it-litert-lm',
  messages: [{ role: 'user', content: 'Write a haiku about tide pools.' }],
  stream: true,
})) {
  render(chunk.choices?.[0]?.delta?.content ?? '');
}

// Free GPU/WASM memory when done with the model
await backend.dispose();
Abort and load progress
const backend = new LiteRtLmBackendAdapter({
  model: MODEL_URL,
  fetchModel: true, // adapter downloads the bundle: byte progress + cancellable download
  onProgress: ({ stage, loaded, total }) => showProgress(stage, loaded, total),
});

await backend.preload({ signal }); // optional: load ahead of the first request
  • stage is download (bytes fetched, total from Content-Length or Blob size), compile, loading (download + compile as one step, when fetchModel is off), then ready.
  • Aborting a request's signal stops execute/executeStream immediately with a STREAM_CANCELLED error and calls conversation.cancel() even if the model has not yielded a token.
  • During load, abort stops waiting at once. With fetchModel the download is cancelled when the last waiter leaves; the runtime cannot interrupt compilation, so a compile in progress finishes in the background and the engine stays cached for the next call. Without fetchModel the runtime owns the download, so abort takes effect after the runtime finishes loading (the engine stays cached).
Requirements & notes
  • WebGPU (Chrome 113+, Safari 17.4+, Firefox 121+). Browser only — no Node.js.
  • Cross-origin isolation may be required for threaded WASM: serve your page with Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp.
  • Model downloads are large (hundreds of MB to GBs). Engines are cached per model URL across adapter instances, so the download/compile happens once per page.
  • Web SDK limits (early preview): text-only, no tool calling, no sampler parameters (temperature/topK/seed are dropped with an IR warning). Prior conversation turns are flattened into a transcript prefix (each request opens a fresh conversation).
  • Models: litert-community on Hugging Face — Gemma-4 E2B (faster) and E4B (better), under the Gemma license.
  • Naming note: @litertjs/core ("LiteRT.js") is Google's tensor-level runtime and cannot run chat models — this adapter wraps LiteRT-LM (@litert-lm/core), the conversation runtime.

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 @johnhenry/aimatey-backend-browser

References

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

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229