dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
Anthropic Claude plan usage indicator for DeepSeek Harness
English | 简体中文
一款精致的 Anthropic Claude 套餐用量指示器,适用于 DeepSeek Harness Web UI。
该插件保留标准的 Settings 齿轮图标和标签,同时在最右侧添加一个上下文用量表样式的圆环。圆环内含 Anthropic 标志,并会在鼠标悬停或键盘聚焦时打开详细的配额面板。
Retry-After 冷却时间;usage endpoint 本身会对激进轮询进行速率限制。claude login);在 Claude Code 持有有效登录信息之前,指示器会显示指向 claude login 的错误状态~/.claude/.credentials.json(macOS 将 credentials 保存在 Keychain 中,目前尚不支持)构建 package:
pnpm install
pnpm run check
从此目录将其添加到 DSH profile:
dsh plugin --profile web add .
dsh --profile web --dump-config
dsh web
开发期间,只有在运行 pnpm run dev 并重新构建插件输出时,Host 更改才会热重载。浏览器客户端更改需要重新构建,然后刷新现有 Web 页面。client bundle 由 DSH 的 client-module system 加载;既不需要也不应使用单独的 Vite server。
使用以下命令移除:
dsh plugin --profile web remove dsh-claude-usage
tarball 随附预构建的 Host 和 lazy-CJS client artifacts,从而避免安装时的构建批准:
pnpm pack
dsh plugin --profile web add ./dsh-claude-usage-0.1.3.tgz
对于 Git-host 安装,pnpm 10 要求 profile 允许此 package 的 prepare script。请固定一个 commit,并严格遵循 DSH/pnpm 输出的 allowBuilds 指令。
所有四个 field 均可在 Settings → Plugins → Claude usage 中使用。更改会在本地暂存直至点击 Save,通过 DSH Settings 持久化;已保存的设置/profile patch 会实时生效,无需重启。profile row 仍是已保存用户覆盖项之下的基础配置。
bundle 会插入以下 row:
- id: claude-usage
name: dsh-claude-usage
config:
refreshIntervalMs: 300000
hoverRefreshMinAgeMs: 30000
requestTimeoutMs: 15000
credentialsFile: ''
在 profile 的 cordis.patch.yml 中覆盖整个 row,以更改 composition-layer base。后续 layer 会替换一个 row 的完整 config value;已保存的 Settings UI value 会覆盖该 base。
| 字段 | 默认值 | 含义 |
|---|---|---|
| refreshIntervalMs | 300000 | 后台轮询间隔;最短 60 seconds。 |
| hoverRefreshMinAgeMs | 30000 | 再次悬停刷新前的最短数据年龄;最短 5 seconds。 |
| requestTimeoutMs | 15000 | 每次 Anthropic usage request 的超时时间。 |
| credentialsFile | (empty) | Claude Code credentials file 的可选绝对路径;留空会选择各 OS 的默认位置。 |
oauth-2025-04-20 beta header。过期 token 会在本地被检测到,并显示 "run claude login" 错误状态,而不是持续冲击 endpoint;Claude Code 会在正常使用过程中刷新自己的登录信息。429 response 会启用感知 Retry-After 的冷却机制,确保后台轮询绝不与 Anthropic 的 rate limiter 冲突。
client artifact 并非普通的 browser ESM。tsdown.config.ts 会生成 DSH 所需的 lazy-CJS registration。React 和 DSH UI packages 保持 external,并通过 DSH 的 client module table 解析,以防止重复的 React runtime。
pnpm run typecheck
pnpm run test
pnpm run build
pnpm run pack:check
默认 suite 会跳过 live provider test。请在已安装 Claude Code 并完成登录时运行:
$env:CLAUDE_LIVE = '1'
pnpm exec vitest run tests/claude-live.spec.ts
MIT