
Security News
Lovable’s OJ Rewrites Vite’s Dev Server in Rust as AI Lowers the Cost of Forking Open Source
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.
@ophirai/sdk
Advanced tools
SDK for the Ophir Agent Negotiation Protocol — BuyerAgent, SellerAgent, Ed25519 signing, Solana escrow, and SLA enforcement
TypeScript SDK for the Ophir Agent Negotiation Protocol. Provides BuyerAgent and SellerAgent classes with built-in cryptographic signing, identity management, escrow integration, SLA tooling, and JSON-RPC transport.
npm install @ophirai/sdk @ophirai/protocol
import { BuyerAgent } from '@ophirai/sdk';
const buyer = new BuyerAgent({ endpoint: 'http://localhost:3002' });
await buyer.listen();
// 1. Request quotes
const session = await buyer.requestQuotes({
sellers: ['http://localhost:3001'],
service: { category: 'inference', requirements: { model: 'vision' } },
budget: { max_price_per_unit: '0.01', currency: 'USDC', unit: 'request' },
sla: { metrics: [{ name: 'p99_latency_ms', target: 500, comparison: 'lte' }] },
});
// 2. Collect and rank quotes
const quotes = await buyer.waitForQuotes(session, { minQuotes: 1, timeout: 30_000 });
const ranked = buyer.rankQuotes(quotes, 'cheapest');
// 3. Accept the best quote
const agreement = await buyer.acceptQuote(ranked[0]);
console.log(agreement.agreement_hash);
import { SellerAgent } from '@ophirai/sdk';
const seller = new SellerAgent({
endpoint: 'http://localhost:3001',
services: [{
category: 'inference',
description: 'GPU inference for vision models',
base_price: '0.005',
currency: 'USDC',
unit: 'request',
}],
});
await seller.listen();
// Seller is now accepting RFQs and auto-generating signed quotes
// Custom RFQ handler
seller.onRFQ(async (rfq) => {
if (rfq.service.category !== 'inference') return null;
return { /* QuoteParams */ };
});
// Custom counter-offer handler
seller.onCounter(async (counter, session) => {
const price = parseFloat(counter.modifications.price_per_unit);
if (price >= 0.004) return 'accept';
if (price < 0.002) return 'reject';
return { /* new QuoteParams */ };
});
| Export | Description |
|---|---|
BuyerAgent | Buy-side agent: send RFQs, collect quotes, rank, accept, counter, dispute |
SellerAgent | Sell-side agent: receive RFQs, generate quotes, handle counters |
See the full API reference for BuyerAgent and SellerAgent.
| Export | Description |
|---|---|
generateKeyPair() | Generate an Ed25519 keypair |
generateAgentIdentity() | Generate a keypair and derive the did:key identifier |
publicKeyToDid(publicKey) | Convert an Ed25519 public key to a did:key URI |
didToPublicKey(did) | Convert a did:key URI back to an Ed25519 public key |
signMessage(params, secretKey) | JCS-canonicalize params, then Ed25519 sign; returns base64 |
verifyMessage(params, signature, publicKey) | Verify a base64 Ed25519 signature against canonicalized params |
canonicalize(obj) | JCS (RFC 8785) canonicalization via json-stable-stringify |
agreementHash(finalTerms) | SHA-256(JCS(finalTerms)) returned as a hex string |
| Export | Description |
|---|---|
EscrowManager | Derive Solana escrow PDAs and interact with the escrow program |
| Export | Description |
|---|---|
SLA_TEMPLATES | Pre-built SLA templates for common service categories |
compareSLAs(offered, required) | Compare an SLA offer against requirements |
meetsSLARequirements(offered, required) | Check if an offer meets all required SLA metrics |
slaToLockstepSpec(sla, agreement) | Convert SLA definition to a Lockstep behavioral specification |
| Export | Description |
|---|---|
JsonRpcClient | HTTP JSON-RPC 2.0 client for sending protocol messages |
NegotiationServer | HTTP JSON-RPC 2.0 server for receiving protocol messages |
NegotiationSession | State machine for tracking a single negotiation lifecycle |
| Export | Description |
|---|---|
BuyerAgentConfig.clearinghouse | Optional ClearinghouseManager for margin assessment and netting |
When a ClearinghouseManager is provided, acceptQuote() automatically:
MARGIN_ASSESSED before ESCROWEDimport { ClearinghouseManager } from '@ophirai/clearinghouse';
const clearinghouse = new ClearinghouseManager({ max_exposure_per_agent: 100_000 });
const buyer = new BuyerAgent({
endpoint: 'http://localhost:3002',
clearinghouse,
});
| Export | Description |
|---|---|
discoverAgents(endpoints) | Discover seller agents via A2A Agent Card endpoints |
parseAgentCard(card) | Parse and validate an A2A Agent Card |
LockstepMonitor | Monitor SLA compliance via the Lockstep verification service |
agreementToX402Headers(agreement) | Convert an Ophir agreement to x402 payment headers |
parseX402Response(response) | Parse x402 payment response into Ophir types |
FAQs
SDK for the Ophir Agent Negotiation Protocol — BuyerAgent, SellerAgent, Ed25519 signing, Solana escrow, and SLA enforcement
The npm package @ophirai/sdk receives a total of 12 weekly downloads. As such, @ophirai/sdk popularity was classified as not popular.
We found that @ophirai/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Lovable’s OJ rewrites Vite’s dev server in Rust, reducing memory use and preview times as AI lowers the cost of open source reimplementation.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.