Introduction

DeepSeek Harness (DSH) uses a plugin-based architecture. In daily use, managing fragmented resources such as prompts, links, and notes often requires manual organization; meanwhile, calculating the total Token cost across all sessions (including archived ones) usually relies on external scripts or manual calculation. The gxx950224/backpack plugin provides DSH with a persistent item inventory and cost accounting system, features a World of Warcraft (WoW) style UI, supports categorized storage of various resource types, and can automatically calculate costs based on DeepSeek’s official dynamic pricing.

Core Features

The plugin mainly addresses two problems: resource management and cost tracking.

Item inventory and categorization management
* Backpack system: A floating action button (FAB) in the lower-right corner or the B key opens the inventory. It supports infinite bags and paginated management (6×4 grid).
* Item types: Automatically recognizes and categorizes links, prompts, notes, skills, files, images, plugins, commands, and other content.
* Void repository: Provides overflow storage space. It cannot be deleted and is used for automatically categorized miscellaneous items.
* Interaction and visuals: Supports dragging items to move them, dragging files into the panel to create items, and hovering over items to view details. The UI has a WoW-like feel, including quality colors, flavor text, and info cards.

Cost accounting
* Automatic accounting: Scans all session logs (including archived ones) and extracts actual Token usage (inputTokens, cacheReadTokens, outputTokens, etc.).
* Currency conversion: Converts costs into gold coins (yuan), silver coins (jiao), and copper coins (fen).
* Dynamic pricing: Charges according to DeepSeek’s official pricing rules and supports peak/off-peak pricing (enabled by default).
* Agent tools: Provides tools such as backpack_add, backpack_money, and backpack_search for Agents to call.

Installation and Enablement

The plugin is installed as a persistent bundle and must be used with the DSH Web profile. Before installing, ensure that the required dependencies are installed.

  1. Install dependencies:
    In the DSH Web profile directory, run:
    pnpm add @ggame/backpack
  1. Register the workspace:
    Edit ~/.dsh/profiles/web/pnpm-workspace.yaml and ensure it includes packages/*:
    packages:
      - .
      - packages/*
  1. Configure the bundle:
    Edit ~/.dsh/profiles/web/package.json and append @ggame/backpack to the dsh.profile.bundles array:
    {
      "dsh": {
        "profile": {
          "bundles": [
            "@deepseek-ai/dsh-base",
            "@deepseek-ai/dsh-web-app",
            "@ggame/backpack"
          ]
        }
      }
    }
  1. Configure plugin parameters:
    Append the following to the end of ~/.dsh/profiles/web/cordis.patch.yml:
    - id: backpack
      config:
        autoScan: true
        scanIntervalSec: 60
  1. Run installation and restart:
    Run pnpm install in the profile directory, then restart DSH Web (dsh web).

Basic Operations

After installation, a backpack button appears in the lower-right corner of the browser.

  • Open/close the backpack: Click the button in the lower-right corner or press the B key.
  • Add an item: Click “+ Item” in the panel and paste content to automatically detect its type; or drag a local file into the panel.
  • Use an item: Double-click the item. Link items open directly; prompt/command items are sent to the input box; skill/plugin items generate invocation text.
  • View details: Right-click an item and select “View” to preview link cards, Markdown rich text, sandboxed HTML pages, images, or plain text.
  • Batch operations: Hold Shift and click to multi-select items. Dragging to reorganize is supported.

Fees and Pricing Rules

Cost statistics are based on the sessionQuery events in DSH logs and the TokenUsage data in assistant/message events.

  • Currency units: 1 gold coin = 1 yuan, 1 silver coin = 0.1 yuan, and 1 copper coin = 0.01 yuan.
  • Pricing model: Supports overriding unit prices by model, or using default pricing. The plugin includes DeepSeek’s official pricing documentation (deepseek-v4-flash, deepseek-v4-pro).
  • Peak/off-peak pricing: Enabled by default. During peak periods (such as 9:00–12:00 and 14:00–18:00), usage is billed at the peak price; during off-peak periods, it is billed at half the peak price. This can be disabled in the configuration.
  • Data maintenance: When pricing rules change (PRICE_REV changes), old records are automatically cleared and rebuilt to avoid incorrect pricing.

Notes

  • Environment requirements: Only applies to the DSH Web profile (dsh web).
  • Installation form: Installed as a persistent bundle, so it remains effective after restarting DSH.
  • Dependencies: Depends on DSH’s bundled peer packages (such as @deepseek-ai/cordis).
  • Data source: Token counts are taken directly from actual log reports, not estimated values.
  • License and icons: The code is licensed under the MIT License; icons are for personal use only and must be replaced before commercial use.

Summary
The backpack plugin integrates resource management and cost control into DSH’s workflow. Through World of Warcraft style interaction, it provides an intuitive item inventory experience and solves the pain point of tracking long-term session costs. Developers can use it to build a more structured local knowledge base and cost management system.

Plugin directory | GitHub repository