{"_id":"@allen0118/dsh-client-ui-whale","name":"@allen0118/dsh-client-ui-whale","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@allen0118/dsh-client-ui-whale","version":"0.1.0","description":"A DeepSeek-logo whale for the DeepSeek Harness web UI whose water spout scales with the live token consumption rate.","type":"module","main":"lib/index.js","exports":{".":{"default":"./lib/index.js"},"./client":{"default":"./lib/client.js"},"./package.json":"./package.json"},"scripts":{"check":"node --check lib/index.js && node --check lib/client.js"},"keywords":["deepseek","deepseek-harness","dsh","plugin","client-plugin","whale","token","react"],"dsh":{"client":{"platform":"web"}},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/AllenYu0118/dsh-client-ui-whale.git"},"gitHead":"4b96a4a5e0aef63217c7115a091258cfaba09a1a","_id":"@allen0118/dsh-client-ui-whale@0.1.0","bugs":{"url":"https://github.com/AllenYu0118/dsh-client-ui-whale/issues"},"homepage":"https://github.com/AllenYu0118/dsh-client-ui-whale#readme","_nodeVersion":"26.5.1","_npmVersion":"11.17.0","dist":{"integrity":"sha512-5dUY8DzUjPrnlHhb5nvdtTMPCFbUr8MzivcNq5qOIGlZ3qXmEZKxS5R3prctU+jcNjRqRM4U2M5Ly4p3S+d/UA==","shasum":"86116d718158420e1af5d428177cc15597c0e47f","tarball":"https://registry.npmjs.org/@allen0118/dsh-client-ui-whale/-/dsh-client-ui-whale-0.1.0.tgz","fileCount":7,"unpackedSize":454775,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEopJqAHZH0/gCGeeY1/ZdoLlUsQ/kPo7Pnj3ETIIt2WAiBqfCNYfPMQ2VrhfdEvW2n/WmpsSmpMHdRcr15uUU2ldg=="}]},"_npmUser":{"name":"allen0118","email":"allen19890118@outlook.com"},"directories":{},"maintainers":[{"name":"allen0118","email":"allen19890118@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-client-ui-whale_0.1.0_1786675700814_0.8944934681032921"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-14T02:48:20.605Z","0.1.0":"2026-08-14T02:48:20.972Z","modified":"2026-08-14T02:48:21.238Z"},"maintainers":[{"name":"allen0118","email":"allen19890118@outlook.com"}],"description":"A DeepSeek-logo whale for the DeepSeek Harness web UI whose water spout scales with the live token consumption rate.","homepage":"https://github.com/AllenYu0118/dsh-client-ui-whale#readme","keywords":["deepseek","deepseek-harness","dsh","plugin","client-plugin","whale","token","react"],"repository":{"type":"git","url":"git+https://github.com/AllenYu0118/dsh-client-ui-whale.git"},"bugs":{"url":"https://github.com/AllenYu0118/dsh-client-ui-whale/issues"},"license":"MIT","readme":"# dsh-client-ui-whale\n\n一个给 DeepSeek Harness（DSH）Web UI 用的小客户端插件：在对话列右侧放一只\nDeepSeek 鲸鱼 logo，喷水的高度、水滴数量与大小会随当前会话的 token **消耗速度**\n（tokens/秒）变化——token 流得越快，鲸鱼喷得越高越猛。\n\n> 鲸鱼是官方 DeepSeek logo 形状（取自随附的 favicon），填充品牌蓝。\n> DeepSeek 是 DeepSeek 的商标；本插件是独立的非官方爱好者项目。\n\n## 演示\n\n![鲸鱼喷水演示](docs/whale-demo.gif)\n\n喷水高度、水滴数量与水滴大小都随实时 token 消耗速度变化：空闲时不喷水，\n流式生成越快，喷得越高越宽。\n\n## 特性\n\n- **悬浮鲸鱼**：紧贴对话列右侧（空间不足时回退到视口角落）。\n- **速度驱动喷水**：喷水高度、水滴数量、水滴大小都随实时 token 消耗速度\n  （tokens/秒）缩放，从 `tokenUsage` 投影每 400ms 采样并做指数平滑。\n- **实时 token 徽章**：鲸鱼下方显示当前 token 数，方便核对联动。\n- 支持深色模式徽章、零构建步骤、无运行时依赖。\n\n## 工作原理\n\nDSH 用客户端插件组合 UI。本包是双面插件：\n\n- `lib/index.js` — Node 侧：空 `apply()`，让包成为已启用的 Loader 条目。\n- `lib/client.js` — 浏览器侧：通过客户端模块系统\n  （`window.__ModuleLoader__.load`）加载，往 `conversation.session.header.actions`\n  slot（session 作用域，因此标准套件携带 `useProjection`）注册一个条目，\n  读取 `useProjection(\"tokenUsage\")`，并把鲸鱼 portal 到 `document.body`。\n\ntoken 数据来自 `@deepseek-ai/dsh-token-meter` 的 `tokenUsage` 投影\n（互斥分桶：`uncachedInputTokens`、`outputTokens`、`cacheReadTokens`、\n`cacheWriteTokens`）。\n\n## 安装\n\n这是源码级客户端插件：需要能被目标 profile 解析，并加为 Loader 行。\n\n### 方式 A — 符号链接 + patch（最快，无需 pnpm）\n\n```sh\nPROFILE=\"$DSH_HOME/profiles/web\"          # 或你的 profile 目录\nmkdir -p \"$PROFILE/node_modules/@deepseek-ai\"\nln -sfn \"$(pwd)\" \"$PROFILE/node_modules/@deepseek-ai/dsh-client-ui-whale\"\n```\n\n然后在 `$PROFILE/cordis.patch.yml` 追加：\n\n```yaml\n- insert:\n    - id: ui-whale\n      name: '@allen0118/dsh-client-ui-whale'\n```\n\n### 方式 B — file 依赖 + pnpm\n\n在 profile 的 `package.json` 里加：\n\n```json\n\"dependencies\": { \"@allen0118/dsh-client-ui-whale\": \"file:/path/to/dsh-client-ui-whale\" }\n```\n\n然后在 profile 目录跑 `pnpm install`，并加上同样的 patch 行。\n\n重启 `dsh web` 并刷新——插件集合的变更只在重启后生效。\n\n## 配置\n\n目前没有配置面；直接改 `lib/client.js`：\n\n- **位置 / 间距**：`useWhalePosition()`（间距为 `16`，回退角落 `right: 28`，\n  窄屏回退 `right: 12`）。\n- **喷水曲线**：`TokenWhale` 里的 `level` 表达式，当前是\n  `Math.min(1, Math.sqrt(rate / 50))`，约 50 tokens/秒时饱和；速率在\n  `useTokenRate()` 里每 400ms 采样一次并做指数平滑。\n- **尺寸**：`spoutH`（8–80px）、`dropCount`（2–6）、`dropSize`（3–6px）。\n- **颜色**：`.whale-drop` / `.whale-svg` / `.whale-count` 的 CSS 规则。\n\n停用：给 `ui-whale` 行加 `disabled: true`（或删除该行）并重启。\n\n## 开发\n\n```sh\nnpm run check   # 对两个 half 做 node --check\n```\n\n`lib/client.js` 是手写的纯 JavaScript，形状正好符合 DSH 客户端模块加载器的\n要求；刻意不引入构建步骤。\n\n## 许可证\n\n[MIT](LICENSE)。DeepSeek logo 仅用于标识。\n","readmeFilename":"README.zh.md","_rev":"1-a23e175106929e9ed1a3d5b66fc10768"}