dsh-deepseek-balance-widget 1.0.0
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/LICENSE +21 -0
- package/README.md +118 -0
- package/README_EN.md +118 -0
- package/cordis.patch.yml +6 -0
- package/lib/client.js +467 -0
- package/lib/index.js +385 -0
- package/package.json +65 -0
- package/scripts/install.ps1 +127 -0
- package/scripts/install.sh +103 -0
- package/skills/dsh-deepseek-balance-widget/SKILL.md +46 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dsh-deepseek-balance-widget
|
|
3
|
+
description: 安装、卸载或检查 dsh 的 DeepSeek 余额侧边栏插件(dsh-deepseek-balance-widget)。用户提到「余额插件」「DeepSeek 余额」「安装余额显示」「装余额小部件」等时使用本技能。
|
|
4
|
+
whenToUse: 用户要求安装、卸载或检查 DeepSeek 余额显示插件(dsh-deepseek-balance-widget)时。
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# dsh-deepseek-balance-widget 安装技能
|
|
9
|
+
|
|
10
|
+
在用户的 dsh(DeepSeek Harness)中安装 / 卸载 / 检查「DeepSeek 余额侧边栏小部件」插件。
|
|
11
|
+
|
|
12
|
+
## 背景
|
|
13
|
+
|
|
14
|
+
- 包名:`dsh-deepseek-balance-widget`(GitHub 托管,npm 包名相同)
|
|
15
|
+
- 作用:侧边栏显示余额 / 今日消费 / 今日Token,点击弹出详情;数据由宿主端用**本机**凭据实时查询,不内置任何密钥。
|
|
16
|
+
- 机制:`dsh plugin --profile web add <包>` 在 pnpm 安装成功后,会**自动把声明了 `dsh.bundle` 的包注册进 `dsh.profile.bundles`**,无需手动改配置文件。
|
|
17
|
+
|
|
18
|
+
## 安装步骤
|
|
19
|
+
|
|
20
|
+
1. **检查前置**:确认 `dsh` 与 `pnpm` 可用(`dsh --version`、`pnpm --version`)。
|
|
21
|
+
2. **安装(GitHub 直装)**:
|
|
22
|
+
```bash
|
|
23
|
+
dsh plugin --profile web add github:crazy-L118/dsh-deepseek-balance-widget
|
|
24
|
+
```
|
|
25
|
+
- 若用户不知道 GitHub 仓库地址,询问用户;若用户手上有本地源码目录,也可用 `file:` 规格安装。
|
|
26
|
+
3. **验证注册**:读取 `~/.dsh/profiles/web/package.json`(Windows 下为 `%USERPROFILE%\.dsh\profiles\web\package.json`),确认:
|
|
27
|
+
- `dependencies` 中有 `dsh-deepseek-balance-widget`
|
|
28
|
+
- `dsh.profile.bundles` 数组包含 `dsh-deepseek-balance-widget`
|
|
29
|
+
- 若 bundles 里没有(旧版 dsh 才可能出现),用编辑工具把它追加进 `dsh.profile.bundles`。
|
|
30
|
+
4. **提示用户**:
|
|
31
|
+
- **重启 `dsh web`** 后侧边栏才会出现余额按钮(安装只改配置文件,不热生效)。
|
|
32
|
+
- 余额需要 `DEEPSEEK_API_KEY`:确认 `~/.dsh/.credentials.yaml` 中已配置(dsh 原本就用 DeepSeek API 的话通常已有)。注意:**只检查键是否存在,不要读取或回显密钥值**。
|
|
33
|
+
- 实时用量(累计/本月/今日消费、请求次数)可选:配置 `DEEPSEEK_PLATFORM_TOKEN`(platform.deepseek.com 登录后 F12 → Application → Cookies → `userToken`)。未配置时余额仍正常显示。
|
|
34
|
+
|
|
35
|
+
## 卸载
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile web rm dsh-deepseek-balance-widget
|
|
39
|
+
```
|
|
40
|
+
`dsh plugin rm` 会同时从 `dsh.profile.bundles` 移除该层;若残留,手动从 `~/.dsh/profiles/web/package.json` 的 `dependencies` 与 `dsh.profile.bundles` 中删除同名条目。
|
|
41
|
+
|
|
42
|
+
## 注意
|
|
43
|
+
|
|
44
|
+
- 安装后必须重启 `dsh web` 才生效;不要重启用户的 dsh 服务(重启动作由用户决定)。
|
|
45
|
+
- 全程不要读取、打印或提交任何凭据值(API Key / userToken)。
|
|
46
|
+
- 若安装失败,先检查 pnpm 是否可用、网络是否可达,再检查报错信息。
|