npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xorne/dsh-deepseek-session-cost

v0.1.4

Published

DSH harness plugin: shows live DeepSeek session cost in USD, priced per model (v4-flash / v4-pro), with peak/off-peak and weekend off-peak rules.

Readme

dsh-deepseek-session-cost

Plugin DeepSeek Harness : affiche le coût de la session (en USD) sous la zone de saisie, facturé par message selon le modèle utilisé (deepseek-v4-flash, deepseek-v4-pro, …), avec l'indicateur visuel off-peak / peak.

$0.0042  ● off-peak · DeepSeek · deepseek-v4-flash · in 1.2k · ⚡0.9k · out 0.3k

Fonctionnalités

  • Par message / par modèle : chaque message assistant est facturé au tarif de son propre modèle (lecture du usage + provenance.model / requestConfig.model).
  • Tarifs officiels : table src/pricing.js extraite de api-docs.deepseek.com/quick_start/pricing (modèles V4), avec rafraîchissement best-effort par l'hôte (web.fetch).
  • Peak / off-peak selon l'heure de Pékin : fenêtre 00:30–08:30 en semaine, et toute la journée le week-end (samedi/dimanche Pékin) depuis le 23/08/2026.
  • Pastille de créneau : vert = off-peak, ambre = peak (tokens de thème DSH).
  • Zéro dépendance hôte obligatoire : le client calcule le coût avec les tarifs intégrés et la logique de créneau locale ; il rafraîchit la table via le RPC hôte si disponible.

Architecture / fichiers

| Fichier | Rôle | |---|---| | src/pricing.js | Modèle de tarif, isOffPeak() (règle week-end), costOfUsage(), formatTokens(). | | src/index.js | Moitié hôte : fetch officiel + exposition des tarifs (harness.handle ou service deepseekPricing). | | src/client.js | Moitié navigateur : slot conversation.composer.dock, composant DeepSeekCostPanel. | | cordis.patch.yml | Entrée dual-face @xorne/dsh-deepseek-session-cost. |

Installation dans un profil

  1. Publier (ou référencer localement) le paquet, puis l'ajouter au profil :

    cd ~/.dsh/profiles/web
    pnpm add @xorne/dsh-deepseek-session-cost
    dsh plugin --profile web add @xorne/dsh-deepseek-session-cost
  2. Le déclarer comme bundle dans package.json (section dsh.profile.bundles) : son cordis.patch.yml insère alors l'entrée dual-face.

    "dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@xorne/dsh-deepseek-session-cost"] } }
  3. Redémarrer le profil (dsh --profile web).

⚠️ Build client : la moitié ./client doit être bundlée par le build frontend (servi sous /plugins/<id>/client.js). En dev, lancer le watcher (pnpm run dev:web depuis l'installation DSH) ; les plugins statiques n'apparaissent qu'après rebuild + refresh. Le plugin dynamique équivalent (via l'outil Cordis) n'a pas ce besoin — c'est ce qui a été testé ici.

Plugins DeepSeek Harness

Catalogue des plugins @deepseek-ai/dsh-* du Harness (hors utilitaires), avec version et description, regroupés par catégorie : voir plugins.md.

Ce catalogue est auto-généré depuis les package.json installés du déploiement. Pour la liste active d'un profil précis (plugins réellement chargés), préférez :

dsh --profile web --dump-config | grep "^- id:"

Publier sur npm

npm login
npm publish

Puis chacun peut faire dsh plugin --profile web add @xorne/dsh-deepseek-session-cost.

Différences avec le plugin dynamique

Le plugin dynamique (défini à l'exécution via l'outil Cordis) utilise le RPC package-privé harness.handle / host.call. Pour un bundle statique :

  • La liaison hôte → client doit suivre la convention du loader : soit harness.handle (si injecté), soit un service @Remote (activé dans src/index.js).
  • src/client.js est autonome : sans RPC, il retombe sur BASE_PRICING et la logique de créneau locale — le plugin reste fonctionnel même sans hôte.

Renommez DEFAULT_MODEL si besoin et vérifiez que le scope @xorne correspond bien à votre username/org npm avant publication.