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

@eiei114/pi-sub-shared

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eiei114/pi-sub-shared

Shared types and event contract for the sub-* ecosystem

latest
Source
npmnpm
Version
2.4.0
Version published
Weekly downloads
118
-80.91%
Maintainers
1
Weekly downloads
 
Created
Source

@eiei114/pi-sub-shared

Shared types, metadata, and event contracts for the sub-* ecosystem.

This package is consumed by sub-core and sub-bar to keep provider metadata, usage types, and model multipliers consistent. For repo setup and extension installation, see the root pi-sub README.

Overview

Installation

npm install @eiei114/pi-sub-shared

Usage

import {
  PROVIDERS,
  ProviderName,
  UsageSnapshot,
  getDefaultCoreSettings,
} from "@eiei114/pi-sub-shared";

const defaults = getDefaultCoreSettings();
const provider: ProviderName = "anthropic";
const snapshot: UsageSnapshot = {
  provider,
  displayName: "Anthropic (Claude)",
  windows: [],
};

console.log(PROVIDERS, defaults, snapshot);

Exports

  • PROVIDERS, ProviderName
  • RateWindow, UsageSnapshot, ProviderUsageEntry
  • UsageError, UsageErrorCode
  • ProviderStatus, StatusIndicator
  • CoreSettings, CoreProviderSettings, CoreProviderSettingsMap
  • BehaviorSettings, DEFAULT_BEHAVIOR_SETTINGS
  • getDefaultCoreSettings, getDefaultCoreProviderSettings
  • SubCoreState, SubCoreAllState, SubCoreEvents
  • ScopedUsageRequest, ScopedUsageResponse, SCOPED_USAGE_EVENT — optional selective base-provider read contract, not account-level identity resolution
  • ProviderMetadata, ProviderDetectionConfig, ProviderStatusConfig
  • PROVIDER_METADATA, PROVIDER_DISPLAY_NAMES
  • MODEL_MULTIPLIERS

Credential vs. account amounts on UsageSnapshot

creditTotal / creditUsage / creditRemaining are account-level (wallet) amounts. creditUnavailable marks a refresh where the wallet could not be read, so callers can say "unknown" instead of showing an older value as current.

keyLimit / keyRemaining / keyUsage describe the credential in use and must never be written into the credit fields. keyLimit is null when the credential has no cap (which says nothing about the wallet) and omitted when the cap could not be determined; neither case has a percentage.

Development

npm run check

FAQs

Package last updated on 08 Sep 2026

Related posts