
Security News
Open VSX Unblocks Extension IDs Used in Malware Campaign
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.
@peac/contracts
Advanced tools
Canonical error codes and verification mode contracts for PEAC Protocol.
This package is the single source of truth for error codes, HTTP status mappings, and verification mode behavior. All surface implementations (workers, middleware) MUST import from this package to prevent contract drift.
pnpm add @peac/contracts
import {
CANONICAL_ERROR_CODES,
CANONICAL_STATUS_MAPPINGS,
MODE_BEHAVIOR,
problemTypeFor,
ERROR_CATALOG,
type PeacErrorCode,
type VerificationMode,
} from '@peac/contracts';
// Get HTTP status for an error code
const status = CANONICAL_STATUS_MAPPINGS[CANONICAL_ERROR_CODES.TAP_SIGNATURE_INVALID];
// 401
// Get RFC 9457 Problem Details type URI
const problemType = problemTypeFor(CANONICAL_ERROR_CODES.TAP_SIGNATURE_INVALID);
// "https://www.peacprotocol.org/problems/E_TAP_SIGNATURE_INVALID"
// Check verification mode behavior
const modeBehavior = MODE_BEHAVIOR.tap_only;
// { noTapHeadersStatus: 401, noTapHeadersCode: 'E_TAP_SIGNATURE_MISSING' }
// Get error catalog entry
const catalogEntry = ERROR_CATALOG[CANONICAL_ERROR_CODES.TAP_SIGNATURE_INVALID];
// { status: 401, title: 'Invalid Signature', defaultDetail: '...' }
PeacErrorCode - Union type of all canonical error codes (compile-time safety)VerificationMode - Union type: 'tap_only' | 'receipt_or_tap'ErrorCatalogEntry - Structure for error catalog entriesCANONICAL_ERROR_CODES - All error codes with E_* prefixCANONICAL_STATUS_MAPPINGS - Error code → HTTP status mappingsCANONICAL_TITLES - Error code → RFC 9457 title mappingsMODE_BEHAVIOR - Verification mode → missing TAP behaviorWWW_AUTHENTICATE_STATUSES - HTTP statuses requiring WWW-Authenticate header [401, 402]ERROR_CATALOG - Full error catalog with status, title, and default detailPROBLEM_TYPE_BASE - Base URI for Problem Details type fieldproblemTypeFor(code: PeacErrorCode): string - Get RFC 9457 type URI for error codegetStatusForCode(code: PeacErrorCode): number - Get HTTP status for error coderequiresWwwAuthenticate(status: number): boolean - Check if status requires WWW-AuthenticateAll error codes use the E_* prefix format:
E_RECEIPT_MISSING - Receipt required but not providedE_RECEIPT_INVALID - Receipt validation failedE_RECEIPT_EXPIRED - Receipt has expiredE_TAP_SIGNATURE_MISSING - TAP headers missingE_TAP_SIGNATURE_INVALID - Signature verification failedE_TAP_TIME_INVALID - Signature time invalidE_TAP_KEY_NOT_FOUND - Signing key not foundE_TAP_REPLAY_PROTECTION_REQUIRED - Replay protection required but not configuredE_TAP_WINDOW_TOO_LARGE - Time window exceeds maximumE_TAP_TAG_UNKNOWN - Unknown signature tagE_TAP_ALGORITHM_INVALID - Invalid signature algorithmE_ISSUER_NOT_ALLOWED - Issuer not in allowlistE_TAP_NONCE_REPLAY - Nonce replay detectedE_CONFIG_ISSUER_ALLOWLIST_REQUIRED - ISSUER_ALLOWLIST required but not configuredE_INTERNAL_ERROR - Internal server errortap_only (Default)Missing TAP headers → 401 + E_TAP_SIGNATURE_MISSING
receipt_or_tapMissing TAP headers → 402 + E_RECEIPT_MISSING (payment remedy)
This package guarantees:
PeacErrorCode union type prevents invalid codesApache-2.0
PEAC Protocol is an open source project stewarded by Originary and community contributors.
FAQs
PEAC canonical error codes and verification mode contracts
We found that @peac/contracts 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
Open VSX has removed three extension IDs from its malicious-extension list as the legitimate publishers they impersonated move to claim the names for themselves.

Product
Socket’s PHP and Composer support is now in Beta for all customers, with PHP reachability analysis generally available.

Product
Socket is bringing experimental protection to Firefox, scanning 97,000+ extensions in Mozilla's official directory for malware and risky updates.