New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@ophirai/registry

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ophirai/registry

Ophir Agent Registry — discovery service for AI agent negotiation

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

@ophirai/registry

Agent discovery registry for the Ophir protocol. Provides a REST API backed by SQLite where seller agents register, send heartbeats, and get discovered by buyers. Includes challenge-based authentication and reputation tracking.

Installation

npm install @ophirai/registry

Usage

Start a registry server

import { createRegistryServer } from '@ophirai/registry';

const registry = createRegistryServer({
  port: 8420,
  dbPath: './ophir-registry.db',
});

await registry.start();

Use the database directly

import { RegistryDB } from '@ophirai/registry';

const db = new RegistryDB('./ophir-registry.db');

// Find inference providers
const agents = db.findAgents({ category: 'inference', minReputation: 0.8 });

// Check an agent
const agent = db.getAgent('did:key:z6Mk...');

REST API

MethodPathAuthDescription
POST/auth/challengeNoGet a signing challenge
POST/agentsYesRegister an agent
GET/agentsNoSearch agents
GET/agents/:agentIdNoGet agent details
POST/agents/:agentId/heartbeatYesKeep-alive ping
DELETE/agents/:agentIdYesUnregister an agent
POST/reputation/:agentIdYesReport agreement outcome
GET/healthNoServer health check

Search query parameters

  • category -- Filter by service category
  • max_price -- Maximum base price
  • currency -- Currency filter
  • min_reputation -- Minimum reputation score (0-1)
  • limit -- Max results

Reputation reporting

curl -X POST http://localhost:8420/reputation/did:key:z6Mk... \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"outcome": "completed", "response_time_ms": 340}'

Outcomes: completed, disputed_won, disputed_lost

What is included

  • createRegistryServer -- Factory that returns an Express app with all routes, a SQLite database, and start/stop lifecycle methods.
  • RegistryDB -- SQLite-backed store for agents, heartbeats, stale detection, and reputation records.
  • createRouter -- Express router with all REST endpoints.
  • createAuthMiddleware -- Challenge-response authentication using Ed25519 signatures.
  • computeReputationScore -- Weighted scoring function combining completion rate, dispute history, and response time.

Configuration

OptionDefaultDescription
port8420HTTP listen port
dbPath./ophir-registry.dbSQLite database path
corsOrigin'https://ophirai.com'CORS allowed origin
staleCheckInterval5Minutes between stale agent checks

Security

  • Rate limiting: Global (100 req/min), challenge endpoint (10/min), reputation (20/min)
  • Body size limit: 16KB max JSON payload
  • Security headers: Helmet middleware (CSP, HSTS, X-Frame-Options, etc.)
  • CORS: Restricted by default (set corsOrigin to your domain)
  • Challenge consumption: Each auth challenge is single-use (deleted after verification)
  • Reputation hardening: Duplicate reports rejected (unique reporter+target+agreement), column whitelist prevents SQL injection
  • LIKE escape: Category search escapes % and _ wildcards

FAQs

Package last updated on 06 Mar 2026

Related posts