@johnnren/dsh-zen 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 +123 -0
- package/README.zh-CN.md +114 -0
- package/assets/icon.svg +9 -0
- package/cordis.patch.yml +3 -0
- package/docs/screenshots/settings.png +0 -0
- package/docs/screenshots/zen-running.png +0 -0
- package/docs/screenshots/zen-view.png +0 -0
- package/lib/client.js +1655 -0
- package/lib/index.js +10 -0
- package/package.json +81 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-zen contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# dsh-zen
|
|
2
|
+
|
|
3
|
+
A Zen Mode view tab + foreground time tracker for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (DSH).
|
|
4
|
+
|
|
5
|
+
While an agent works in the background, switch to the **Zen** tab and get a calm, minimal
|
|
6
|
+
surface: a status message, your latest user message, and one line of statistics — no tool
|
|
7
|
+
calls, no reasoning rows, no noise. Zen also tracks how much of your "running" time was spent
|
|
8
|
+
actually watching the screen, and reports a daily / weekly Zen score.
|
|
9
|
+
|
|
10
|
+
[中文说明](./README.zh-CN.md)
|
|
11
|
+
|
|
12
|
+
## Screenshots
|
|
13
|
+
|
|
14
|
+
Zen view (while generating) | Zen view (done) | Zen settings
|
|
15
|
+
:---: | :---: | :---:
|
|
16
|
+
 |  | 
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Zen view tab** — a dedicated `conversation.view` tab (`对话 / Zen / 轨迹`), showing:
|
|
21
|
+
- running / done status message (configurable, with or without the second-line description)
|
|
22
|
+
- your user message (while generating), the previous round's reply and live activity hints
|
|
23
|
+
- the final AI reply rendered with markdown
|
|
24
|
+
- one-line turn stats: `步数 N · 用时 Nm · 统计`
|
|
25
|
+
- **Foreground time tracker** — records foreground (visible window) vs. total running time
|
|
26
|
+
per session, persisted in `localStorage`. Daily / weekly **Zen score** (`100% − 盯屏比例`)
|
|
27
|
+
is shown in the settings panel.
|
|
28
|
+
- **Chat hide toggle** — a header button (`隐藏中间过程`) that hides tool-call, command,
|
|
29
|
+
context, compaction, reasoning rows, etc. from the chat view via CSS.
|
|
30
|
+
- **Auto enter / exit Zen** — optional: auto-switch to the Zen tab when a task starts, and
|
|
31
|
+
back to chat when it completes.
|
|
32
|
+
- **Shortcut** — press `Alt+Z` to toggle between the Zen and chat views from anywhere.
|
|
33
|
+
- **Animation toggle** — disable all entry animations/transitions in Zen view if you prefer
|
|
34
|
+
instant rendering.
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
This plugin is distributed as a DSH bundle. It requires a Web-capable profile (the default
|
|
39
|
+
`web` profile).
|
|
40
|
+
|
|
41
|
+
### From a Git repository (recommended)
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
dsh plugin --profile web add github:john-walks-slow/dsh-zen#<40-character-commit>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then restart `dsh web`. The bundle patch (`cordis.patch.yml`) inserts the `zen` row
|
|
48
|
+
into the profile's composition, and the Web client is served from the committed `lib/client.js`.
|
|
49
|
+
|
|
50
|
+
> Prefer pinning the exact commit hash; a floating branch can be force-pushed. See
|
|
51
|
+
> [docs/PUBLISHING.md](docs/PUBLISHING.md) for the catalog submission flow.
|
|
52
|
+
|
|
53
|
+
### From npm (once published)
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dsh plugin --profile web add @johnnren/dsh-zen
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
1. Open any conversation in the DSH Web GUI.
|
|
62
|
+
2. Click the **Zen** tab (or press `Alt+Z`) to switch to the Zen view.
|
|
63
|
+
3. Optionally use the **隐藏中间过程** button in the session header to collapse
|
|
64
|
+
intermediate process nodes in the chat view.
|
|
65
|
+
4. Open **Settings → Zen 设置** to configure what is shown:
|
|
66
|
+
- 显示进行中标题 / 显示进行中副标题 / 显示结束标题 — status message title/subtitle on/off
|
|
67
|
+
- 生成中显示用户消息 / 生成中显示上轮回复 / 生成中显示动态 — hints shown while generating
|
|
68
|
+
- 显示本轮轮次和用时 — the `步数 N · 用时 Nm` line
|
|
69
|
+
- 显示盯屏时间统计 — the foreground stats tooltip
|
|
70
|
+
- 自动进入禅 / 自动解除禅 — auto view switching on task start / complete
|
|
71
|
+
- 动效 — entry animations on/off
|
|
72
|
+
|
|
73
|
+
The settings panel also shows your **今日禅 / 本周禅** scores and the current Zen level.
|
|
74
|
+
|
|
75
|
+
## Development
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
npm install
|
|
79
|
+
npm run build # bundle src/client.ts + src/index.ts → lib/, deploy into web profile
|
|
80
|
+
npm run typecheck # tsc --noEmit against the local shims in src/dts-shim.d.ts
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The deploy target is `$DSH_HOME/profiles/web/node_modules` (default `~/.dsh`). Client-only
|
|
84
|
+
changes need a page refresh; host-side changes need a DSH restart.
|
|
85
|
+
|
|
86
|
+
### Repository layout
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
├── src/
|
|
90
|
+
│ ├── client.ts # Web client: slots, settings section, shortcuts
|
|
91
|
+
│ ├── index.ts # Host face (empty apply; bundle row only)
|
|
92
|
+
│ ├── foreground-tracker.ts# Foreground time tracking + persistence
|
|
93
|
+
│ ├── zen-settings.ts # Settings store + migration
|
|
94
|
+
│ ├── locales.ts # zh / en dictionaries
|
|
95
|
+
│ └── components/ # ZenView, ChatHideToggle, ZenSettingsSection
|
|
96
|
+
├── lib/ # Committed build artifacts (client factory bundle + host)
|
|
97
|
+
├── assets/icon.svg # Plugin icon
|
|
98
|
+
├── cordis.patch.yml # Bundle patch: inserts the zen row
|
|
99
|
+
├── build.mjs # esbuild bundler + deploy
|
|
100
|
+
└── docs/ # Screenshots and publishing guide
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Compatibility
|
|
104
|
+
|
|
105
|
+
- Requires DeepSeek Harness with the Web client module system (default `web` profile).
|
|
106
|
+
- Slot contracts used: `conversation.view`, `conversation.session.header.actions`,
|
|
107
|
+
`settings.section`. Verify against your Harness version's source snapshot if upgrading.
|
|
108
|
+
- **Zero permissions**: no network requests, no file system access, no external
|
|
109
|
+
services — the host face is an empty `apply()` and all data stays in browser
|
|
110
|
+
`localStorage` (`dsh.zen.*`). 无网络请求、无文件写入、无外部服务、无遥测。
|
|
111
|
+
|
|
112
|
+
## Uninstall
|
|
113
|
+
|
|
114
|
+
```sh
|
|
115
|
+
dsh plugin --profile web remove @johnnren/dsh-zen
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Or remove the row from the profile composition. Stored stats/settings in `localStorage`
|
|
119
|
+
can be cleared by deleting keys prefixed `dsh.zen.`.
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
MIT — see [LICENSE](LICENSE).
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# dsh-zen
|
|
2
|
+
|
|
3
|
+
为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)打造的 **禅(Zen)模式视图** + **前台盯屏时间统计** 插件。
|
|
4
|
+
|
|
5
|
+
当智能体在后台干活时,切到 **Zen** 标签页,得到一块干净、极简的界面:一条状态文案、你最新发出的用户消息、一行统计——没有工具调用、没有推理过程、没有噪音。同时 Zen 会记录你「任务运行中」到底有多少时间真的盯着屏幕,并给出每日 / 每周禅值。
|
|
6
|
+
|
|
7
|
+
[English README](./README.md)
|
|
8
|
+
|
|
9
|
+
## 截图
|
|
10
|
+
|
|
11
|
+
禅视图(生成中) | 禅视图(完成态) | 设置面板
|
|
12
|
+
:---: | :---: | :---:
|
|
13
|
+
 |  | 
|
|
14
|
+
|
|
15
|
+
## 功能
|
|
16
|
+
|
|
17
|
+
- **Zen 视图标签** —— 独立的 `conversation.view` 标签(对话 / Zen / 轨迹),展示:
|
|
18
|
+
- 进行中 / 结束状态文案(可配置,第二行描述可隐藏)
|
|
19
|
+
- 生成中的用户消息、上轮回复与动态提示
|
|
20
|
+
- 最终 AI 回复(Markdown 渲染)
|
|
21
|
+
- 一行本轮统计:`步数 N · 用时 Nm · 统计`
|
|
22
|
+
- **前台盯屏统计** —— 按会话记录「窗口可见」时长与「运行」总时长,持久化在 `localStorage`。
|
|
23
|
+
设置面板展示每日 / 每周 **禅值**(`100% − 盯屏比例`)与当前禅等级。
|
|
24
|
+
- **隐藏中间过程按钮** —— 会话头部按钮(`隐藏中间过程`),通过 CSS 一键隐藏对话视图中的
|
|
25
|
+
工具调用、命令、上下文注入、压缩、推理行等中间节点。
|
|
26
|
+
- **自动进出禅** —— 可选:任务开始时自动切入 Zen 标签,任务完成时自动切回对话。
|
|
27
|
+
- **快捷键** —— 任意位置按 `Alt+Z` 在 Zen 视图与对话视图间切换。
|
|
28
|
+
- **动效开关** —— 可关闭 Zen 视图内的全部入场动画与过渡,改为瞬时渲染。
|
|
29
|
+
|
|
30
|
+
## 安装
|
|
31
|
+
|
|
32
|
+
本插件以 DSH bundle 形式分发,需要 Web 能力 profile(默认 `web` profile)。
|
|
33
|
+
|
|
34
|
+
### 从 Git 仓库安装(推荐)
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
dsh plugin --profile web add github:john-walks-slow/dsh-zen#<40位commit>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
然后重启 `dsh web`。bundle 补丁(`cordis.patch.yml`)会把 `zen` 行插入 profile 组合,
|
|
41
|
+
Web 客户端由已提交的 `lib/client.js` 提供。
|
|
42
|
+
|
|
43
|
+
> 建议固定完整 commit 哈希,避免分支被强推导致安装内容漂移。
|
|
44
|
+
> 商店上架流程见 [docs/PUBLISHING.md](docs/PUBLISHING.md)。
|
|
45
|
+
|
|
46
|
+
### 从 npm 安装(发布后可用)
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
dsh plugin --profile web add @johnnren/dsh-zen
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 使用
|
|
53
|
+
|
|
54
|
+
1. 在 DSH Web GUI 打开任意会话。
|
|
55
|
+
2. 点击 **Zen** 标签(或按 `Alt+Z`)进入禅视图。
|
|
56
|
+
3. 可选:使用会话头部的「隐藏中间过程」按钮折叠对话视图中的中间过程节点。
|
|
57
|
+
4. 打开 **设置 → Zen 设置** 配置显示内容:
|
|
58
|
+
- 显示进行中文案 / 显示结束文案 —— 状态文案开关
|
|
59
|
+
- 生成中显示用户消息 / 生成中显示上轮回复 / 生成中显示动态 —— 生成中的提示
|
|
60
|
+
- 显示本轮轮次和用时 —— `步数 N · 用时 Nm` 一行
|
|
61
|
+
- 显示盯屏时间统计 —— 前台统计 tooltip
|
|
62
|
+
- 自动进入禅 / 自动解除禅 —— 任务开始 / 完成时自动切换视图
|
|
63
|
+
- 动效 —— 入场动画开关
|
|
64
|
+
|
|
65
|
+
设置面板同时展示 **今日禅 / 本周禅** 分数与当前禅等级。
|
|
66
|
+
|
|
67
|
+
## 开发
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
npm install
|
|
71
|
+
npm run build # 打包 src/client.ts + src/index.ts → lib/,部署到 web profile
|
|
72
|
+
npm run typecheck # 基于 src/dts-shim.d.ts 本地 shim 做 tsc --noEmit
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
部署目标为 `$DSH_HOME/profiles/web/node_modules`(默认 `~/.dsh`)。仅客户端改动刷新页面即可;
|
|
76
|
+
host 侧改动需要重启 DSH。
|
|
77
|
+
|
|
78
|
+
### 仓库结构
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
├── src/
|
|
82
|
+
│ ├── client.ts # Web 客户端:slots、设置分区、快捷键
|
|
83
|
+
│ ├── index.ts # Host 面(空 apply;仅 bundle 行)
|
|
84
|
+
│ ├── foreground-tracker.ts# 前台时长统计 + 持久化
|
|
85
|
+
│ ├── zen-settings.ts # 设置 store + 迁移
|
|
86
|
+
│ ├── locales.ts # zh / en 词典
|
|
87
|
+
│ └── components/ # ZenView、ChatHideToggle、ZenSettingsSection
|
|
88
|
+
├── lib/ # 已提交的构建产物(client factory bundle + host)
|
|
89
|
+
├── assets/icon.svg # 插件图标
|
|
90
|
+
├── cordis.patch.yml # bundle 补丁:插入 zen 行
|
|
91
|
+
├── build.mjs # esbuild 打包 + 部署
|
|
92
|
+
└── docs/ # 截图与发布指南
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 兼容性
|
|
96
|
+
|
|
97
|
+
- 需要带 Web 客户端模块系统的 DeepSeek Harness(默认 `web` profile)。
|
|
98
|
+
- 使用的 slot 契约:`conversation.view`、`conversation.session.header.actions`、
|
|
99
|
+
`settings.section`。升级 Harness 版本时请对照对应源码快照核验。
|
|
100
|
+
- **零权限**:无网络请求、无文件写入、无外部服务——host 面是空的 `apply()`,
|
|
101
|
+
所有数据保存在浏览器 `localStorage`(`dsh.zen.*`),无遥测。
|
|
102
|
+
|
|
103
|
+
## 卸载
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
dsh plugin --profile web remove @johnnren/dsh-zen
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
或从 profile 组合中移除对应行。如需清除数据,删除 `localStorage` 中前缀为
|
|
110
|
+
`dsh.zen.` 的键。
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT — 见 [LICENSE](LICENSE)。
|
package/assets/icon.svg
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
|
|
2
|
+
<rect width="128" height="128" rx="24" fill="#0f172a"/>
|
|
3
|
+
<circle cx="64" cy="64" r="40" fill="none" stroke="#38bdf8" stroke-width="8"/>
|
|
4
|
+
<path d="M64 24v24M64 80v24" stroke="#38bdf8" stroke-width="8" stroke-linecap="round"/>
|
|
5
|
+
<path d="M64 30c-14 0-24 10-24 24 0 8 5 12 5 12h38s5-4 5-12c0-14-10-24-24-24z" fill="#0ea5e9" opacity="0.25"/>
|
|
6
|
+
<circle cx="52" cy="58" r="4" fill="#38bdf8"/>
|
|
7
|
+
<circle cx="76" cy="58" r="4" fill="#38bdf8"/>
|
|
8
|
+
<path d="M56 68h16" stroke="#38bdf8" stroke-width="5" stroke-linecap="round"/>
|
|
9
|
+
</svg>
|
package/cordis.patch.yml
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|