dsh-tokenlens 1.0.4 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@
5
5
  用 `scripts/bump-version.mjs <version> "<说明>"` 一次完成 `package.json` + `index.js`
6
6
  (`PLUGIN_VERSION`)+ 本文件的同步更新。
7
7
 
8
+ ## 1.0.5 — 2026-10-29
9
+
10
+ - feat(market): 提供 DSH 插件市场索引(market/index.json + icon)并支持发布后自动同步;README 增加从 DSH 市场安装的说明
11
+
8
12
  ## 1.0.4 — 2026-10-29
9
13
 
10
14
  - chore: 插件市场元数据(dsh-plugin 关键词、engines.dsh)与 GitHub 源安装说明
package/README.en.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  > One glance at your usage: plan capacity for the selected provider plus local token statistics across harnesses, right below the DSH composer.
11
11
 
12
- **dsh-TokenLens** is a usage plugin for DSH (DeepSeek Harness), version v1.0.4. It keeps two kinds of numbers separate:
12
+ **dsh-TokenLens** is a usage plugin for DSH (DeepSeek Harness), version v1.0.5. It keeps two kinds of numbers separate:
13
13
 
14
14
  - **Plan capacity** — the provider's authoritative server-side values (percentage windows, used / cap, balance or remaining credit);
15
15
  - **Local token stats** — tokens consumed on this machine across every connected harness, for the selected provider or for all providers combined.
@@ -57,9 +57,7 @@ Everything is computed locally: zero runtime dependencies, no external database,
57
57
 
58
58
  Prerequisites: DSH Desktop 0.2.1-rc.3 or newer 0.2.x (the plugin declares `engines.dsh: ">=0.2.1-rc.3 <0.3.0-0"`, and DSH bundles Node.js 24), an existing DSH profile, and `$DSH_HOME` (default `~/.dsh`).
59
59
 
60
- **Option A — from npm (recommended once published).**
61
-
62
- > If `dsh-tokenlens` is not on npm yet, use Option B below.
60
+ **Option A — from npm (recommended).** `dsh-tokenlens` is published on [npm](https://www.npmjs.com/package/dsh-tokenlens); the DSH install-source picker also offers a mainland-China mirror.
63
61
 
64
62
  ```powershell
65
63
  dsh plugin --profile <profile> add dsh-tokenlens
@@ -68,13 +66,13 @@ dsh plugin --profile <profile> add dsh-tokenlens
68
66
  Then make sure `dsh.profile.bundles` in `$DSH_HOME/profiles/<profile>/package.json` contains `"dsh-tokenlens"`:
69
67
 
70
68
  ```jsonc
71
- { "dependencies": { "dsh-tokenlens": "^1.0.4" },
69
+ { "dependencies": { "dsh-tokenlens": "^1.0.5" },
72
70
  "dsh": { "profile": { "bundles": ["…", "dsh-tokenlens"] } } }
73
71
  ```
74
72
 
75
73
  Restart DSH or wait for profile hot recomposition.
76
74
 
77
- **Option B — from GitHub (available now).** In DSH, open **Plugins → Add plugin**, enter `https://github.com/daigahou/dsh-tokenlens` (or `github:daigahou/dsh-tokenlens`) and install. DSH selects the bundle in `dsh.profile.bundles` and enables it by default. CLI equivalent (installs the dependency only; add `"dsh-tokenlens"` to `dsh.profile.bundles` yourself):
75
+ **Option B — from GitHub.** In DSH, open **Plugins → Add plugin**, enter `https://github.com/daigahou/dsh-tokenlens` (or `github:daigahou/dsh-tokenlens`) and install. DSH selects the bundle in `dsh.profile.bundles` and enables it by default. CLI equivalent (installs the dependency only; add `"dsh-tokenlens"` to `dsh.profile.bundles` yourself):
78
76
 
79
77
  ```powershell
80
78
  dsh plugin --profile <profile> add "github:daigahou/dsh-tokenlens"
@@ -84,6 +82,17 @@ GitHub installs track the latest commit on the default branch (not a tag); updat
84
82
 
85
83
  **Option C — from source.** `dsh plugin --profile <profile> add "link:<path-to-dsh-tokenlens>"`.
86
84
 
85
+ **Option D — from the DSH plugin market.** This repository maintains a DSH plugin market index ([`market/index.json`](market/index.json)); add it once and the plugin shows up in the **Discover** tab with a one-click install:
86
+
87
+ 1. DSH → **Plugins** → **More** next to *Experimental plugins* → enable **Custom plugin market**;
88
+ 2. Open **Discover** → **Add index source** → paste:
89
+ ```
90
+ https://raw.githubusercontent.com/daigahou/dsh-tokenlens/main/market/index.json
91
+ ```
92
+ 3. Search for `TokenLens` in **Discover** and install.
93
+
94
+ > The index is served over GitHub raw; use Option A instead on networks that cannot reach GitHub. Each release workflow run adds the new version to the index automatically.
95
+
87
96
  Uninstall: `dsh plugin --profile <profile> remove dsh-tokenlens`, remove it from `dsh.profile.bundles`, restart DSH.
88
97
 
89
98
  ## Configuration summary
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  > **一眼看清你的用量**:在 DSH 输入框下方显示当前供应商的套餐容量,并汇总本机跨 Harness 的 Token 消耗。
11
11
 
12
- **dsh-TokenLens(词元透镜)** 是 DSH(DeepSeek Harness)的用量插件(v1.0.4,公开版本)。它把两类数字**按不同口径**分开呈现:
12
+ **dsh-TokenLens(词元透镜)** 是 DSH(DeepSeek Harness)的用量插件(v1.0.5,公开版本)。它把两类数字**按不同口径**分开呈现:
13
13
 
14
14
  - **套餐容量**(供应商服务端权威值):百分比窗口、`已用 / 上限`、账户余额或剩余额度;
15
15
  - **本机 Token 统计**(本机记录):当前供应商在本机所有已接入 Harness 上的合计用量,也可切到「全部 Harness」看总账。
@@ -86,13 +86,14 @@
86
86
 
87
87
  | 安装方式 | 适用场景 |
88
88
  |---|---|
89
- | [方式 A:从 npm 安装](#方式-a从-npm-安装推荐) | 插件已发布到 npm 后(推荐,可走「中国大陆镜像源」) |
90
- | [方式 B:从 GitHub 安装](#方式-b从-github-安装当前可用) | npm 发布前,或想直接跟仓库最新代码 |
89
+ | [方式 A:从 npm 安装](#方式-a从-npm-安装推荐) | 推荐;国内用户可选「中国大陆镜像源」 |
90
+ | [方式 B:从 GitHub 安装](#方式-b从-github-安装当前可用) | npm 不可用时,或想直接跟仓库最新代码 |
91
91
  | [方式 C:本地源码 link](#方式-c本地开发从源码-link) | 开发者改代码 |
92
+ | [方式 D:从 DSH 插件市场安装](#方式-d从-dsh-插件市场安装) | 在 DSH「发现」页浏览/一键安装 |
92
93
 
93
94
  ### 方式 A:从 npm 安装(推荐)
94
95
 
95
- > 若 npm 上还查不到 `dsh-tokenlens`(尚未发布时),请先用[方式 B](#方式-b从-github-安装当前可用) 从 GitHub 安装。
96
+ `dsh-tokenlens` 已发布到 npm(最新版见 [npm](https://www.npmjs.com/package/dsh-tokenlens));国内网络可在 DSH 的安装源里选择「中国大陆镜像源」。
96
97
 
97
98
  1. 用 DSH 自带的 `dsh` CLI 安装插件包:
98
99
 
@@ -105,7 +106,7 @@ dsh plugin --profile <profile> add dsh-tokenlens
105
106
  ```jsonc
106
107
  {
107
108
  "dependencies": {
108
- "dsh-tokenlens": "^1.0.0"
109
+ "dsh-tokenlens": "^1.0.5"
109
110
  },
110
111
  "dsh": {
111
112
  "profile": {
@@ -155,6 +156,19 @@ dsh plugin --profile <profile> add "link:<path-to-dsh-tokenlens>"
155
156
 
156
157
  本地开发时,Host 端(`index.js` / `lib/`)改动需要重启或重新加载 profile 才能生效;浏览器端 `client.js` 的改动可能被客户端热替换。
157
158
 
159
+ ### 方式 D:从 DSH 插件市场安装
160
+
161
+ 本仓库维护了一份 DSH 插件市场索引([`market/index.json`](market/index.json)),在 DSH 里添加一次索引源,就能在「发现」页搜索、查看并一键安装:
162
+
163
+ 1. 打开 DSH → 侧边栏「插件」→「实验性插件」旁的「更多」→ 打开 **自定义插件市场**;
164
+ 2. 「已安装」旁出现 **发现** 标签 → 点 **添加索引源**,粘贴:
165
+ ```
166
+ https://raw.githubusercontent.com/daigahou/dsh-tokenlens/main/market/index.json
167
+ ```
168
+ 3. 在「发现」里搜索 `TokenLens`(或浏览 `dsh-TokenLens` 卡片)→ 安装。
169
+
170
+ > 索引通过 GitHub raw 分发;无法访问 GitHub 的网络环境请改用[方式 A](#方式-a从-npm-安装推荐)。索引里的版本信息由 release workflow 在每次发布后自动更新。
171
+
158
172
  ### 验证安装
159
173
 
160
174
  - 输入框下方出现用量 chip(未配置凭据的供应商会被隐藏,属正常现象);
package/index.js CHANGED
@@ -71,7 +71,7 @@ export const inject = []
71
71
  export const PLUGIN_NAME = 'dsh-tokenlens'
72
72
 
73
73
  /** Plugin version; mirrors package.json (kept here so diagnostics need no fs read). */
74
- export const PLUGIN_VERSION = '1.0.4'
74
+ export const PLUGIN_VERSION = '1.0.5'
75
75
 
76
76
  /** Documented defaults; every field of the raw row config is optional. */
77
77
  const DEFAULTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenlens",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "type": "module",
5
5
  "description": "dsh-TokenLens (词元透镜) — provider-aware plan capacity plus local token statistics (today/7d/30d/all-time, by harness/provider/model/workspace) for DSH.",
6
6
  "license": "MIT",