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

@nia-teams/agent-bridge-core

Latest version: v0.3.6

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: nia-teams-admin
2 Stars
0 Forks
11 Versions
1.9K Downloads
TypeScript Repo language

Scan summary

@nia-teams/agent-bridge-core was last scanned on 25 Nov 2026 at version 0.3.6. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 11 versions; the latest 4 were published within 7 days (19–25 Nov 2026).
  • Findings: No rules fired in version 0.3.6.
  • Downloads: 1,912 downloads.

Versions

11 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.6 LATEST 25 Nov 2026 No rules fired
0.3.5 22 Nov 2026 No rules fired
0.3.4 22 Nov 2026 No rules fired
0.3.3 19 Nov 2026 Not shown
0.3.2 18 Nov 2026 Not shown

No rules fired in 0.3.6

Findings

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

README

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

@nia-teams/agent-bridge-core

English | 简体中文

Node.js SDK for connecting any external Agent runtime into Nia Teams as an Agent in Nia Teams with two-way communication.

npm install @nia-teams/agent-bridge-core

AI guide: skills/agent-bridge-core/SKILL.md · node_modules/@nia-teams/agent-bridge-core/skills/agent-bridge-core/SKILL.md.

For terminal QR setup with WeChat and optional GroupChat invites, see WeChat connect.

Run node examples/wechat-connect.mjs from this package directory to try the WeChat SDK example. It saves credentials without starting a runtime. Call connectWithWeChat to embed the flow. Its onScan callback receives the QR payload URL and expiry; use runConnectCli for terminal output. The result reports mode: 'paired' | 'reused', the credentials, and the chat and handoff details.

Core Concepts

BridgeClient connects over WebSocket with protocolVersion: 3. Its getContract() method returns collaboration instructions from ready.systemPrompt and tool definitions (name, description, inputSchema, deferLoading?) from ready.tools. Use resolveThreadPrompt(frame) for incoming prompts.

A TurnRunner returns void and invokes handshake-advertised collaboration tools through context.callTool (context.send and context.history remain convenience wrappers for send_message and chat_history). SessionHost does not publish return text.

pairHost saves host Ed25519 credentials; BridgeClient opens a challenge/lease-authenticated WebSocket; adapters run GroupChat turns; PublicationQueue publishes replies. Consumer runtimes own models, tools, and local permissions.

Consumer runtime This package Nia Teams
Models, tools, workspace, and sessions Pairing, authentication, reconnection, and publication Chat identity, routing, and activity
Execute or deny tool requests Verify signed TaskBar confirmation Membership checks, approval cards, and signing
Supply clientName / PNG avatar Report opaque branding on pairing and every lease handshake Display pairing and GroupChat identity via lightweight avatar URLs

Client Name & Avatar

Adapters carry their own product name (clientName) and PNG image (avatar). Pass them to pairHost({ clientName, avatar, ...options }) for pairing/start and new BridgeClient(credentials, { clientName, avatar }) for every lease handshake/reconnect. SessionHostOptions / runSessionDaemon accept the same optional fields. Custom Node.js Agents can supply their own branding; core and Teams have no client registry, so adding a client requires no server changes.

clientName is trimmed to 1–80 characters without control characters. avatar must be data:image/png;base64,..., with decoded PNG file size ≤64 KiB and dimensions ≤1024×1024; SVG and remote image URLs are rejected. Pairing pages and GroupChat identities automatically display the supplied icon. Upgrading and starting an already-paired client synchronizes branding through verified leases, without re-pairing. Omitted lease fields preserve stored branding; custom user avatars win. APIs return lightweight image URLs, not inline image data.

See the protocol. Supply branding at both pairing and connection entry points; browser approval alone never commits host branding before successful proof of private-key possession.

Quick Start

Requires Node.js 20+. These ESM examples run as .mjs files with node.

1. Pair the host
import { defaultConfigDir, pairHost } from '@nia-teams/agent-bridge-core';

await pairHost({
  configDir: defaultConfigDir('my-agent', 'MY_AGENT_CONFIG_DIR'),
  hostLabel: 'my-agent',
  onPairing: ({ verificationUrl }) => console.log(verificationUrl),
});

Open the printed URL in a browser to create or rebind an external Agent. Later connections load the saved credentials.

2. Receive and reply to GroupChat messages
import { BridgeClient, defaultConfigDir, loadCredentials, resolveThreadPrompt } from '@nia-teams/agent-bridge-core';

const configDir = defaultConfigDir('my-agent', 'MY_AGENT_CONFIG_DIR');
const bridge = new BridgeClient(await loadCredentials(configDir), {
  onError: error => console.error(error.message),
});
bridge.onThreadMessage(async frame => {
  console.log(resolveThreadPrompt(frame));
  await bridge.rpc('tool.call', {
    sessionId: frame.sessionId,
    toolCallId: frame.deliveryId,
    name: 'send_message',
    arguments: { content: 'Received' },
  });
  await bridge.rpc('thread.activity', {
    sessionId: frame.sessionId,
    state: 'idle',
    deliveryId: frame.deliveryId,
  });
});
bridge.onThreadCancel(() => {});
bridge.onCardAction(() => {});
bridge.onReady(frame => console.log('Connected:', frame.agent.slug));
process.once('SIGINT', () => bridge.close());
process.once('SIGTERM', () => bridge.close());
await bridge.start();

For a model-backed runtime, pass resolveThreadPrompt(frame) and bridge.getContract() to the model. Publish replies through tool.call and report turn completion through thread.activity with state: 'idle' and the processed deliveryId.

Run the packaged examples:

node node_modules/@nia-teams/agent-bridge-core/examples/pair.mjs
node node_modules/@nia-teams/agent-bridge-core/examples/connect.mjs

Modules & Exports

Subpath Purpose
/types Credentials, push frames, and RPC types
/crypto Ed25519 signing and deterministic thread IDs
/credentials Private credential validation and atomic access
/pairing pairHost, runPairingCli, acquireLease
/bridge-client BridgeClient, BridgeRpcError
/publications Bounded idempotent PublicationQueue
/format formatThreadMessage GroupChat prompt formatting
/http Origin validation and HTTP requests
/state JsonFileStore, ThreadMapStore, and private state paths
/process IdleSleepGuard and executable discovery

The root entry also exports runtime services:

Export Purpose
SessionHost GroupChat queues, session resume, cancellation, questions, and approval cards
runSessionDaemon Assemble BridgeClient and SessionHost with signal-driven shutdown and PID tracking
stopSessionDaemon Stop the daemon registered in a given config directory
consumeSdkQuery Consume SDK events and synchronize sessions and activity without publishing text
ThreadMapStore Persist per-GroupChat consumer runtime session IDs
IdleSleepGuard Prevent system sleep with caffeinate while tasks run on macOS

Types: dist/**/*.d.ts. Frames and signing: docs/SPECIFICATION.md.

Security & Boundaries

  • Use an adapter-specific config directory; POSIX directory/file modes are 0700/0600, and loading validates keys and paths.
  • Register push handlers before start(); delivery is acknowledged after all handlers succeed.
  • Before executing a card action, call verifyCardApproval with the expected card, tool, and arguments to verify RS256 human confirmation.
  • PublicationQueue retries process-local publications using idempotency keys; the queue is not persisted across restarts.
  • Raw sender IDs are messages[].authorId; member IDs are groupChat.members[].id. Native mentions use <mention userId="24-hex-id" />.
  • Session ID mapping does not provide filesystem or OS isolation.

Development & License

npm install
npm run build
npm run typecheck
npm test

MIT © Nia Teams

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 @nia-teams/agent-bridge-core

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

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

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

Copy of Template Design OX Blog (1)
Research

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

PHP2Shell, Day 5 93.6% of Measurable Instances Still Unpatched (1)
Vulnerability Insights

PHP2Shell, Day 5: The Panic Hasn’t Turned Into Patching

Frame 2085668439 (1)
Group 1261154229