@laoyuehanni/dsh-token-usage 0.3.7 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -122,13 +122,13 @@ Not supported yet: Volcengine, ZenMux, Zhipu Team plan, Claude / Codex / Gemini
122
122
 
123
123
  ## Install
124
124
 
125
- ### From GitHub (recommended)
125
+ ### From npm
126
126
 
127
127
  ```sh
128
- dsh plugin --profile web add github:LaoYueHanNi/dsh-token-usage
128
+ dsh plugin --profile web add @laoyuehanni/dsh-token-usage
129
129
  ```
130
130
 
131
- > The package declares `dsh.bundle`, so `add` wires the plugin into the profile's layer stack automatically — no config editing needed. The built `lib/` ships in the repo (there is no `prepare` script), so git installs work out of the box without any build allowlist. The first startup runs one history backfill, afterwards it records in real time.
131
+ > The package declares `dsh.bundle`, so `add` wires the plugin into the profile's layer stack automatically — no config editing needed. The compiled `lib/` ships in the npm tarball, so installs work out of the box without any build step. The first startup runs one history backfill, afterwards it records in real time.
132
132
 
133
133
  ### From a local directory (development)
134
134
 
@@ -141,13 +141,13 @@ dsh plugin --profile web add link:D:/plugins/dsh-token-usage
141
141
  ## Update
142
142
 
143
143
  ```sh
144
- dsh plugin --profile web update dsh-token-usage
144
+ dsh plugin --profile web update @laoyuehanni/dsh-token-usage
145
145
  ```
146
146
 
147
147
  ## Remove
148
148
 
149
149
  ```sh
150
- dsh plugin --profile web remove dsh-token-usage
150
+ dsh plugin --profile web remove @laoyuehanni/dsh-token-usage
151
151
  ```
152
152
 
153
153
  The plugin is removed from the profile and stops loading. Data files under `$DSH_HOME/token-usage/` are kept — delete them manually if you no longer need them.
@@ -161,7 +161,7 @@ npm install
161
161
  npm run build && npm run build:client
162
162
  ```
163
163
 
164
- > **No `prepare` script — by design.** The compiled `lib/` output is committed to the repo. pnpm ≥ 10 refuses to run build scripts of git-hosted dependencies unless they are allowlisted (`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`), so a `prepare` script would break the zero-config `github:` install for every user. Shipping prebuilt output instead keeps `dsh plugin add github:LaoYueHanNi/dsh-token-usage` working out of the box. **After changing anything under `src/`, always rebuild and commit the updated `lib/`**, or installs will get stale output:
164
+ > **No `prepare` script — by design.** The compiled `lib/` output is committed to the repo and ships in the npm tarball. pnpm ≥ 10 refuses to run dependency build scripts unless they are allowlisted, so a `prepare` script would surface as a skipped or failed install step for pnpm users. Shipping prebuilt output instead keeps `dsh plugin add @laoyuehanni/dsh-token-usage` working out of the box. **After changing anything under `src/`, always rebuild and commit the updated `lib/`** (and release a new version), or installs will get stale output:
165
165
 
166
166
  ```sh
167
167
  npm run build && npm run build:client
package/README.zh.md CHANGED
@@ -126,13 +126,13 @@ Web 卡片提供数据目录与地区切换两项;全部配置项(均为可
126
126
 
127
127
  ## 安装
128
128
 
129
- ### 从 GitHub 安装(推荐)
129
+ ### 从 npm 安装
130
130
 
131
131
  ```sh
132
- dsh plugin --profile web add github:LaoYueHanNi/dsh-token-usage
132
+ dsh plugin --profile web add @laoyuehanni/dsh-token-usage
133
133
  ```
134
134
 
135
- > 包声明了 `dsh.bundle`,`add` 会自动把插件挂进 profile 的层栈,无需手动改配置。构建产物 `lib/` 随仓库提交(没有 `prepare` 脚本),git 安装开箱即用,无需任何构建白名单配置。首次启动自动补齐一次历史记录,之后纯实时记录。
135
+ > 包声明了 `dsh.bundle`,`add` 会自动把插件挂进 profile 的层栈,无需手动改配置。构建产物 `lib/` 随 npm 包分发,安装开箱即用,无需任何构建步骤。首次启动自动补齐一次历史记录,之后纯实时记录。
136
136
 
137
137
  ### 从本地目录安装(开发调试用)
138
138
 
@@ -145,13 +145,13 @@ dsh plugin --profile web add link:D:/plugins/dsh-token-usage
145
145
  ## 更新
146
146
 
147
147
  ```sh
148
- dsh plugin --profile web update dsh-token-usage
148
+ dsh plugin --profile web update @laoyuehanni/dsh-token-usage
149
149
  ```
150
150
 
151
151
  ## 移除
152
152
 
153
153
  ```sh
154
- dsh plugin --profile web remove dsh-token-usage
154
+ dsh plugin --profile web remove @laoyuehanni/dsh-token-usage
155
155
  ```
156
156
 
157
157
  插件会从 profile 移除并停止加载。数据文件(`$DSH_HOME/token-usage/`)会保留,需要时手动删除。
@@ -165,7 +165,7 @@ npm install
165
165
  npm run build && npm run build:client
166
166
  ```
167
167
 
168
- > **刻意不设 `prepare` 脚本。** 编译产物 `lib/` 已提交进仓库。pnpm ≥ 10 默认拒绝执行 git-hosted 依赖的构建脚本,除非加入白名单(报错 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`),因此若保留 `prepare`,每个用户用 `github:` 安装都会失败。改为随仓库分发预构建产物后,`dsh plugin add github:LaoYueHanNi/dsh-token-usage` 才能零配置开箱即用。**改动 `src/` 下的任何文件后,务必重新构建并提交更新后的 `lib/`**,否则别人安装到的是旧产物:
168
+ > **刻意不设 `prepare` 脚本。** 编译产物 `lib/` 已提交进仓库并随 npm 包分发。pnpm ≥ 10 默认拒绝执行依赖的构建脚本,除非加入白名单,因此若保留 `prepare`,pnpm 用户的安装会跳过或失败。改为分发预构建产物后,`dsh plugin add @laoyuehanni/dsh-token-usage` 才能零配置开箱即用。**改动 `src/` 下的任何文件后,务必重新构建并提交更新后的 `lib/`**(并发布新版本),否则别人安装到的是旧产物:
169
169
 
170
170
  ```sh
171
171
  npm run build && npm run build:client
package/cordis.patch.yml CHANGED
@@ -4,4 +4,4 @@
4
4
  # manual profile editing is needed). The row references the package by name.
5
5
  - insert:
6
6
  - id: token-usage
7
- name: 'dsh-token-usage'
7
+ name: '@laoyuehanni/dsh-token-usage'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laoyuehanni/dsh-token-usage",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "dsh local plugin: persist per-request model token usage (live hook + first-run history backfill + web settings stats page)",
5
5
  "keywords": [
6
6
  "dsh",