{"_id":"@changqingguo/dsh-peak-valley-indicator","_rev":"2-a2949ee63e2de550c311cab7d092c4cf","name":"@changqingguo/dsh-peak-valley-indicator","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@changqingguo/dsh-peak-valley-indicator","version":"1.0.0","keywords":["dsh","dsh-plugin","deepseek-harness","web-ui","peak","valley","electricity","indicator"],"license":"MIT","_id":"@changqingguo/dsh-peak-valley-indicator@1.0.0","maintainers":[{"name":"changqingguo","email":"762323483@qq.com"}],"homepage":"https://github.com/ChangQGuo/dsh-peak-valley-indicator#readme","bugs":{"url":"https://github.com/ChangQGuo/dsh-peak-valley-indicator/issues"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"dist":{"shasum":"4b0d1e11f069be841fe88dc5aea8768814d2ee94","tarball":"https://registry.npmjs.org/@changqingguo/dsh-peak-valley-indicator/-/dsh-peak-valley-indicator-1.0.0.tgz","fileCount":7,"integrity":"sha512-+/Dh3uUOaOcpSvHqv35y3KRaggqUkwpknWm2vG86w+Bv2ckqjR8sbqQCSLGDjPkhXtQ8MaUFo7WgbB9rkfL54A==","signatures":[{"sig":"MEQCIBUOKd70shXPj8K3IPbx4unAiq9jDYvZfFy4KVFaj+NPAiB1sSlZwUTwEfh45KD8XsGEdJViwh207qaec0YNJohGPw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13866},"main":"lib/index.js","type":"module","engines":{"node":">=18"},"exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},"gitHead":"59a6d6e1fbe3a7833f15c54e75d069ac7e7ce93f","_npmUser":{"name":"changqingguo","email":"762323483@qq.com"},"repository":{"url":"git+https://github.com/ChangQGuo/dsh-peak-valley-indicator.git","type":"git"},"_npmVersion":"11.12.1","description":"Peak/valley electricity-time indicator beside the Session Log in the DSH Web header. Red light during peak hours (09:00-12:00 & 14:00-18:00 local time), green otherwise.","directories":{},"_nodeVersion":"24.15.0","_hasShrinkwrap":false,"peerDependencies":{"react":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/dsh-peak-valley-indicator_1.0.0_1787116503265_0.13695007503304435","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@changqingguo/dsh-peak-valley-indicator","version":"1.0.1","description":"Peak/valley electricity-time indicator beside the Session Log in the DSH Web header. Red light during peak hours (09:00-12:00 & 14:00-18:00 local time), green otherwise.","keywords":["dsh","dsh-plugin","deepseek-harness","web-ui","peak","valley","electricity","indicator"],"license":"MIT","type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"},"client":{"inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"],"platform":"web"}},"repository":{"type":"git","url":"git+https://github.com/ChangQGuo/dsh-peak-valley-indicator.git"},"bugs":{"url":"https://github.com/ChangQGuo/dsh-peak-valley-indicator/issues"},"homepage":"https://github.com/ChangQGuo/dsh-peak-valley-indicator#readme","engines":{"node":">=18"},"peerDependencies":{"react":"^18.2.0"},"gitHead":"db1f750b57fff8c2e41bb7f822d6c553993ef0b4","_id":"@changqingguo/dsh-peak-valley-indicator@1.0.1","_nodeVersion":"24.15.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-KpVfyAX43+CmwzSe4iw3oNB94/mlCOinXo9f8GZQt3PoJsRqrsKRs/7lb7f9se8/4gji4w6p3k/JX6KivB4jZg==","shasum":"4a9ec36348847d9f4a110cd6b0f53d4c03b469b0","tarball":"https://registry.npmjs.org/@changqingguo/dsh-peak-valley-indicator/-/dsh-peak-valley-indicator-1.0.1.tgz","fileCount":7,"unpackedSize":15307,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC3M0ijrmUN+GioYF30m6R59otUv8SphvCfN9PlIoaLFgIgS+mfQPLENT0TYJgONd9IdG2GgjxFLud5iKePIVlNAnE="}]},"_npmUser":{"name":"changqingguo","email":"762323483@qq.com"},"directories":{},"maintainers":[{"name":"changqingguo","email":"762323483@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-peak-valley-indicator_1.0.1_1787448202385_0.02304039979838901"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-19T05:15:03.099Z","modified":"2026-08-23T01:23:22.683Z","1.0.0":"2026-08-19T05:15:03.505Z","1.0.1":"2026-08-23T01:23:22.531Z"},"bugs":{"url":"https://github.com/ChangQGuo/dsh-peak-valley-indicator/issues"},"license":"MIT","homepage":"https://github.com/ChangQGuo/dsh-peak-valley-indicator#readme","keywords":["dsh","dsh-plugin","deepseek-harness","web-ui","peak","valley","electricity","indicator"],"repository":{"type":"git","url":"git+https://github.com/ChangQGuo/dsh-peak-valley-indicator.git"},"description":"Peak/valley electricity-time indicator beside the Session Log in the DSH Web header. Red light during peak hours (09:00-12:00 & 14:00-18:00 local time), green otherwise.","maintainers":[{"name":"changqingguo","email":"762323483@qq.com"}],"readme":"# @changqingguo/dsh-peak-valley-indicator\n\n[English](README.md) | 中文\n\nDSH Web 的**峰/谷电价时段指示灯**。在页面右上角会话头部、**Session log** 按钮旁边，加一个会呼吸闪烁的**红/绿小灯 + 文字标签 + 实时时钟**，让你一眼看出当前是用电**峰时**还是**谷时**。\n\n- **峰时（红灯）**：工作日 `09:00–12:00`、`14:00–18:00`\n- **谷时（绿灯）**：其余所有时段——**含周末（周六/周日）全天**（最新政策）\n\n峰/谷按**浏览器本机当地时间**判断，因此自动跟随你的时区（如北京时间）。无需配置，不占用任何提示面、零 token 开销。\n\n```text\nSession log   [● 峰时 14:30]      ← 红灯呼吸 + 红色文字\nSession log   [● 谷时 21:08]      ← 绿灯呼吸 + 绿色文字\n```\n\n## 功能\n\n- **客户端**：在 `conversation.session.header.utilities` 槽位注册一个条目——即会话头部右侧的工具行，与 **Session log** 同一行。该条目渲染一个紧凑胶囊：一个 10 px 呼吸灯（峰时红、谷时绿）+ `峰时`/`谷时` 文字 + 每秒跳动的 `HH:MM` 时钟。峰/谷由浏览器本地时区的 `new Date().getHours()` 计算。CSS 通过一个 `<style data-plugin>` 标签注入一次，随插件卸载而清理。\n- **宿主侧**：无操作占位（`apply` 为空），仅用于让 loader 为这个纯客户端行构建一个有效的 host fiber。不注入服务、不注册命令、不发事件。\n\n## 安装\n\n把包装进你的 DSH Web profile，然后重启 `dsh web`：\n\n```sh\n# 推荐：直接从 npm 安装（发布后）\ndsh plugin --profile web add @changqingguo/dsh-peak-valley-indicator\n\n# 或从仓库安装（开发调试）\ngit clone https://github.com/ChangQGuo/dsh-peak-valley-indicator.git\ndsh plugin --profile web add link:$(pwd)/dsh-peak-valley-indicator\n```\n\n本包自带挂载行（`cordis.patch.yml`），无需手动改 patch——重启 `dsh web` 后指示灯自动出现在 **Session log** 旁边。\n\n也可以作为普通 overlay 行写进你的 profile patch（`~/.dsh/profiles/web/cordis.patch.yml`）：\n\n```yaml\n- insert:\n    - id: peak-valley-indicator\n      name: '@changqingguo/dsh-peak-valley-indicator'\n```\n\n## 配置\n\n无。峰谷时段硬编码在 `lib/client.js` 的 `isPeak` 里：\n\n```js\nreturn (h >= 9 && h < 12) || (h >= 14 && h < 18);\n```\n\n改这个表达式并重新部署即可调整峰/谷时刻表。\n\n## 导出形态\n\n纯客户端 Cordis 插件：浏览器侧导出 `inject: [\"slots\"]` 与 `apply`，由 `apply` 调用 `ctx.slots.inject(\"conversation.session.header.utilities\", …)` 注册胶囊。宿主侧导出无操作的 `apply`、`inject: []`、`name: \"peak-valley-indicator\"`。无默认导出，也无公开 Service。\n\n## 模型体验\n\n### 提示与工具面\n\n#### 模型看到什么\n\n什么也看不到。插件不注入提示段落、不注册工具、也不发 `session` 事件——它只是一个纯展示型浏览器小部件。\n\n#### Token 影响\n\n每个请求为零。\n\n#### KV 缓存影响\n\n无系统提示贡献，因此对缓存稳定性无影响。\n\n## 已知限制与待办\n\n- **仅 Web**：指示灯渲染在 DSH Web 的会话头部；暂无 TUI 等价物。\n- **时刻表硬编码**：峰谷时段写死在源码里（`09:00–12:00`、`14:00–18:00`），无运行时配置；改 `lib/client.js` 后重新部署即可。\n- **仅当地时间**：按浏览器本机时区判断，不锁定某个时区。本机时间为北京时间的机器上，即跟随北京时间。\n- **纯展示**：无持久化、无设置页、无按会话状态——时钟在浏览器端每秒重算。\n","readmeFilename":"README.zh.md"}