
Company News
Socket Joins New OpenJS Program to Fund Node.js Security Work
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.
@ophirai/protocol
Advanced tools
Core protocol definitions for the Ophir Agent Negotiation Protocol — types, schemas, state machine, SLA metrics, and error codes
Core protocol definitions for the Ophir Agent Negotiation Protocol. This package contains TypeScript types, Zod validation schemas, constants, and error codes shared by all Ophir packages.
npm install @ophir/protocol
import {
METHODS,
DEFAULT_CONFIG,
RFQParamsSchema,
QuoteParamsSchema,
CounterParamsSchema,
AcceptParamsSchema,
RejectParamsSchema,
DisputeParamsSchema,
OphirError,
OphirErrorCode,
} from '@ophir/protocol';
import type {
RFQParams,
QuoteParams,
CounterParams,
AcceptParams,
RejectParams,
DisputeParams,
FinalTerms,
SLAMetricName,
NegotiationState,
} from '@ophir/protocol';
import { RFQParamsSchema, QuoteParamsSchema } from '@ophir/protocol';
// Throws ZodError if validation fails
const rfq = RFQParamsSchema.parse(incomingData);
const quote = QuoteParamsSchema.parse(incomingData);
import { METHODS, DEFAULT_CONFIG } from '@ophir/protocol';
METHODS.RFQ; // "negotiate/rfq"
METHODS.QUOTE; // "negotiate/quote"
METHODS.COUNTER; // "negotiate/counter"
METHODS.ACCEPT; // "negotiate/accept"
METHODS.REJECT; // "negotiate/reject"
METHODS.DISPUTE; // "negotiate/dispute"
DEFAULT_CONFIG.rfq_timeout_ms; // 300000 (5 minutes)
DEFAULT_CONFIG.quote_timeout_ms; // 120000 (2 minutes)
DEFAULT_CONFIG.counter_timeout_ms; // 120000 (2 minutes)
DEFAULT_CONFIG.max_negotiation_rounds; // 5
import { OphirError, OphirErrorCode } from '@ophir/protocol';
try {
// ... protocol operation
} catch (err) {
if (err instanceof OphirError) {
console.error(err.code); // e.g., "OPHIR_002"
console.error(err.message); // Human-readable description
console.error(err.data); // Optional structured context
}
}
TypeScript interfaces for every protocol message:
RFQParams, QuoteParams, CounterParams, AcceptParams, RejectParams, DisputeParamsFinalTerms, AgentIdentity, ServiceRequirement, BudgetConstraintSLARequirement, SLAMetric, SLAMetricNamePricingOffer, VolumeDiscount, EscrowRequirementViolationEvidence, NegotiationStateZod validation schemas for runtime message validation:
RFQParamsSchema, QuoteParamsSchema, CounterParamsSchemaAcceptParamsSchema, RejectParamsSchema, DisputeParamsSchemaMETHODS -- RPC method name constantsDEFAULT_CONFIG -- Default timeouts, currency, escrow seeds, max roundsOphirErrorCode -- Enum of all error codes (OPHIR_001 through OPHIR_402)OphirError -- Typed error class with code, message, and optional datauptime_pct | p50_latency_ms | p99_latency_ms | accuracy_pct |
throughput_rpm | error_rate_pct | time_to_first_byte_ms | custom
IDLE -> RFQ_SENT -> QUOTES_RECEIVED -> COUNTERING -> ACCEPTED ->
ESCROWED -> ACTIVE -> COMPLETED | REJECTED | DISPUTED -> RESOLVED
FAQs
Core protocol definitions for the Ophir Agent Negotiation Protocol — types, schemas, state machine, SLA metrics, and error codes
The npm package @ophirai/protocol receives a total of 6 weekly downloads. As such, @ophirai/protocol popularity was classified as not popular.
We found that @ophirai/protocol 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.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.

Research
/Security News
A malicious Firefox extension fetches its payload after installation to evade detection, steal Google session cookies, and automate account takeover.