dsh-cursor-whale 0.0.0-stage → 0.2.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-cursor-whale 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 CHANGED
@@ -1,3 +1,100 @@
1
- # Temporary Holding Version
1
+ # dsh-cursor-whale · 跟随鼠标的鲸鱼
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 把 [dsh-mini](https://www.npmjs.com/package/dsh-mini) 的小窗收成一只**跟着鼠标走的透明鲸鱼**:平时它是一张贴在光标右下的小鲸鱼,按鼠标前进键就变回真正的 DSH 小窗。
4
+
5
+ Windows only · 需要 DSH 桌面端 + dsh-mini
6
+
7
+ ![小窗、鲸鱼与光标](docs/preview.svg)
8
+
9
+ ## 它做什么
10
+
11
+ - dsh-mini 的小窗不挡桌面时,收成 96×55 的透明鲸鱼,跟着光标走(16ms 刷新);
12
+ - 鼠标**前进键**一键切回小窗,再按一次收回鲸鱼;
13
+ - 鼠标**后退键**切换主窗 ⇄ 小窗;
14
+ - 鼠标**移出小窗**自动收成鲸鱼;
15
+ - 全部是系统级热键,DSH 最小化/被遮挡时也能用。
16
+
17
+ ## 安装
18
+
19
+ 在 DSH 里让 Agent 安装:
20
+
21
+ ```
22
+ plugin_manager → install_bundle → target: "dsh-cursor-whale@0.2.1"
23
+ ```
24
+
25
+ 或命令行:
26
+
27
+ ```sh
28
+ dsh plugin --profile desktop add dsh-cursor-whale
29
+ ```
30
+
31
+ 安装后插件会:
32
+
33
+ 1. 把 `app/DSH-Hotkey.exe` 和鲸鱼图复制到 `%LOCALAPPDATA%\DSH-Hotkey`(不覆盖已有的 `hotkey.ini`);
34
+ 2. 启动这个托盘助手;
35
+ 3. 插件被禁用/卸载时把助手一起退出。
36
+
37
+ ## 使用
38
+
39
+ | 操作 | 行为 |
40
+ | --- | --- |
41
+ | 鼠标**后退键** | 主窗 ⇄ 小窗 |
42
+ | 鼠标**前进键** | 鲸鱼 ⇄ 小窗 |
43
+ | 鼠标移出小窗 | 收成鲸鱼跟随光标 |
44
+ | `Ctrl+Alt+\`` | 手动切换鲸鱼/小窗 |
45
+ | `Ctrl+Alt+Shift+Q` | 退出助手 |
46
+
47
+ ## 配置
48
+
49
+ `%LOCALAPPDATA%\DSH-Hotkey\hotkey.ini`,保存后约 2 秒生效:
50
+
51
+ ```ini
52
+ toggle = XButton1 # 主窗 ⇄ 小窗
53
+ openMini = XButton2 # 鲸鱼 ⇄ 小窗
54
+ follow = Ctrl+Alt+` # 手动切换
55
+ quit = Ctrl+Alt+Shift+Q
56
+
57
+ whaleScale = 3 # 鲸鱼宽度 = 系统指针宽度 × 该倍数
58
+ whaleOffsetX = 16 # 相对光标的偏移
59
+ whaleOffsetY = 16
60
+ whaleImage = whale-alpha.png
61
+ ```
62
+
63
+ ## 要求
64
+
65
+ - Windows 10/11 **x64**;
66
+ - 已安装 **dsh-mini** 插件(小窗与 `/dsh-mini/open` 接口由它提供);
67
+ - **DSH 桌面端**(网页版没有可折叠的小窗)。
68
+
69
+ ## 已知限制
70
+
71
+ - 助手是**未签名**的 exe,首次运行可能被 SmartScreen 拦一次;
72
+ - 小窗第一次打开需 2~4 秒(WebView2 现起窗口),之后切换是毫秒级;
73
+ - 自动拉起的小窗落在首页(接口不带会话 id),点小窗标题栏的 `▯` 才是当前会话;
74
+ - 只认进程名 `DeepSeek Harness` / `DSH小窗`,第三方壳或纯网页版不适用。
75
+
76
+ ## 从源码构建
77
+
78
+ 托盘助手是 C#(.NET Framework 4.x),插件半边是普通 ESM:
79
+
80
+ ```powershell
81
+ ./build.ps1 # 用系统自带 csc 编译 src/DshHudHotkey.cs → app/DSH-Hotkey.exe
82
+ ```
83
+
84
+ 编译后重启 DSH(或禁用再启用插件)即可加载新 exe。
85
+
86
+ ## 目录结构
87
+
88
+ ```
89
+ ├── app/ # 运行资源(exe、鲸鱼图、默认配置)
90
+ ├── src/DshHudHotkey.cs # 托盘助手源码(全局热键、窗口控制、鲸鱼渲染)
91
+ ├── lib/index.js # DSH 插件 Host 半边(复制资源 + 启停助手)
92
+ ├── locale/ # 插件页显示名与描述(zh/en)
93
+ ├── docs/ # 插件详情页与预览图
94
+ ├── cordis.patch.yml # 插件挂载声明
95
+ └── build.ps1 # 重新编译助手
96
+ ```
97
+
98
+ ## License
99
+
100
+ [MIT](LICENSE)
Binary file
package/app/hotkey.ini ADDED
@@ -0,0 +1,21 @@
1
+ # DSH 折叠热键配置。改完保存,约 2 秒内自动生效,不用重启。
2
+ # 写法:修饰键(Ctrl/Alt/Shift/Win,可组合)+ 一个按键。
3
+ # 按键可用:A-Z 0-9 F1-F24 ` - = [ ] \ ; ' , . / Space Enter Esc Tab Delete Home End PageUp PageDown Up Down Left Right PrintScreen
4
+ # 想关掉某个热键,就把它留空:toggle =
5
+
6
+ toggle = XButton1
7
+ follow = Ctrl+Alt+`
8
+ quit = Ctrl+Alt+Shift+Q
9
+ openMini = XButton2
10
+
11
+ # 跟随鼠标时窗口中心相对光标的纵向偏移(负数往上)
12
+ followOffsetY = 24
13
+
14
+ # 鼠标侧键被绑定时,是否吞掉它原本的「后退/前进」动作(true = 只给 DSH 用)
15
+ blockMouseButton = true
16
+
17
+ # 跟随鼠标的鲸鱼:宽度 = 系统指针宽度 × whaleScale;位置相对光标右下
18
+ whaleScale = 3
19
+ whaleOffsetX = 16
20
+ whaleOffsetY = 16
21
+ whaleImage = whale-alpha.png
Binary file
Binary file
package/build.ps1 ADDED
@@ -0,0 +1,29 @@
1
+ # Rebuild the tray helper from source.
2
+ #
3
+ # Requirements: .NET Framework 4.x shipped with Windows 10/11 (provides csc.exe).
4
+ # Output: app\DSH-Hotkey.exe
5
+
6
+ $ErrorActionPreference = 'Stop'
7
+ $root = Split-Path -Parent $MyInvocation.MyCommand.Path
8
+ $csc = Join-Path $env:WINDIR 'Microsoft.NET\Framework64\v4.0.30319\csc.exe'
9
+
10
+ if (-not (Test-Path $csc)) {
11
+ throw "csc.exe not found: $csc (.NET Framework 4.x is required)"
12
+ }
13
+
14
+ Push-Location $root
15
+ try {
16
+ & $csc /nologo /target:winexe `
17
+ /r:System.Windows.Forms.dll `
18
+ /r:System.Drawing.dll `
19
+ /out:app\DSH-Hotkey.exe `
20
+ src\DshHudHotkey.cs
21
+
22
+ if ($LASTEXITCODE -ne 0) { throw "compile failed (csc exit $LASTEXITCODE)" }
23
+
24
+ Copy-Item assets\whale-alpha.png app\whale-alpha.png -Force
25
+ Write-Host "built app\DSH-Hotkey.exe"
26
+ }
27
+ finally {
28
+ Pop-Location
29
+ }
@@ -0,0 +1,7 @@
1
+ # dsh-cursor-whale —— 跟随鼠标的鲸鱼(Windows 托盘助手)
2
+ #
3
+ # 只挂一个 Host 行:启动随包携带的 DSH-Hotkey.exe,按本插件生命周期运行/退出。
4
+
5
+ - insert:
6
+ - id: cursor-whale
7
+ name: dsh-cursor-whale
package/docs/DETAIL.md ADDED
@@ -0,0 +1 @@
1
+ ![Transparent whale following the cursor beside a small dsh-mini window](preview.svg)
@@ -0,0 +1 @@
1
+ ![透明鲸鱼跟随鼠标,旁边是 dsh-mini 小窗](preview.zh.svg)
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <rect x="24" y="24" width="592" height="252" rx="24" fill="#0F172A"/>
3
+ <rect x="60" y="60" width="220" height="180" rx="12" fill="#111E33" stroke="#2AA7E0" stroke-opacity="0.55" stroke-width="2"/>
4
+ <rect x="76" y="76" width="188" height="14" rx="7" fill="#2AA7E0" fill-opacity="0.55"/>
5
+ <rect x="76" y="100" width="150" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.45"/>
6
+ <rect x="76" y="116" width="168" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.32"/>
7
+ <rect x="76" y="132" width="120" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.22"/>
8
+ <path d="M300 214c34-58 96-96 150-92" fill="none" stroke="#2AA7E0" stroke-width="3" stroke-dasharray="9 11" stroke-linecap="round" stroke-opacity="0.6"/>
9
+ <g transform="translate(352 108) scale(2.3)">
10
+ <path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
11
+ <path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
12
+ <circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
13
+ <circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
14
+ </g>
15
+ <g transform="translate(556 196)">
16
+ <path d="M0 0 L0 30 L8 22 L14 34 L21 30 L15 18 L26 19 Z" fill="#E2E8F0" stroke="#0F172A" stroke-width="1.6" stroke-linejoin="round"/>
17
+ </g>
18
+ </svg>
@@ -0,0 +1,18 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="640" height="300" viewBox="0 0 640 300">
2
+ <rect x="24" y="24" width="592" height="252" rx="24" fill="#0F172A"/>
3
+ <rect x="60" y="60" width="220" height="180" rx="12" fill="#111E33" stroke="#2AA7E0" stroke-opacity="0.55" stroke-width="2"/>
4
+ <rect x="76" y="76" width="188" height="14" rx="7" fill="#2AA7E0" fill-opacity="0.55"/>
5
+ <rect x="76" y="100" width="150" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.45"/>
6
+ <rect x="76" y="116" width="168" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.32"/>
7
+ <rect x="76" y="132" width="120" height="8" rx="4" fill="#CBD5E1" fill-opacity="0.22"/>
8
+ <path d="M300 214c34-58 96-96 150-92" fill="none" stroke="#2AA7E0" stroke-width="3" stroke-dasharray="9 11" stroke-linecap="round" stroke-opacity="0.6"/>
9
+ <g transform="translate(352 108) scale(2.3)">
10
+ <path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
11
+ <path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
12
+ <circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
13
+ <circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
14
+ </g>
15
+ <g transform="translate(556 196)">
16
+ <path d="M0 0 L0 30 L8 22 L14 34 L21 30 L15 18 L26 19 Z" fill="#E2E8F0" stroke="#0F172A" stroke-width="1.6" stroke-linejoin="round"/>
17
+ </g>
18
+ </svg>
package/icon.svg ADDED
@@ -0,0 +1,7 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
2
+ <rect width="96" height="96" rx="20" fill="#0B2A3A"/>
3
+ <path d="M18 52c0-11 9-19 21-19 10 0 18 5 21 13l9-7-2 11 2 11-9-7c-3 8-11 13-21 13-12 0-21-8-21-15z" fill="#2AA7E0"/>
4
+ <path d="M18 52c0 7 9 15 21 15 6 0 11-2 15-5-6 1-13-1-17-5-5-5-7-11-8-15-6 3-11 6-11 10z" fill="#DCEFFA"/>
5
+ <circle cx="55" cy="45" r="4.5" fill="#0B2A3A"/>
6
+ <circle cx="56.5" cy="43.5" r="1.6" fill="#FFFFFF"/>
7
+ </svg>
package/lib/index.js ADDED
@@ -0,0 +1,106 @@
1
+ /**
2
+ * dsh-cursor-whale — Host 半边。
3
+ *
4
+ * 做的事只有三件:
5
+ * 1. 把随包携带的 DSH-Hotkey.exe / whale-alpha.png 复制到 %LOCALAPPDATA%\DSH-Hotkey
6
+ * (不覆盖用户已有的 hotkey.ini)
7
+ * 2. 启动这个托盘程序
8
+ * 3. 插件卸载/进程退出时把它收掉
9
+ *
10
+ * 真正的热键与窗口逻辑都在那个 exe 里,它通过 dsh-mini 的 /dsh-mini/open 接口操作小窗。
11
+ */
12
+
13
+ import { spawn } from 'node:child_process'
14
+ import { copyFileSync, existsSync, mkdirSync, writeFileSync } from 'node:fs'
15
+ import { homedir } from 'node:os'
16
+ import { dirname, join } from 'node:path'
17
+ import { fileURLToPath } from 'node:url'
18
+
19
+ const PLUGIN_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
20
+
21
+ let child = null
22
+
23
+ function localAppData() {
24
+ return process.env.LOCALAPPDATA || join(homedir(), 'AppData', 'Local')
25
+ }
26
+
27
+ function defaultIni() {
28
+ return [
29
+ '# DSH 折叠热键配置。改完保存,约 2 秒内自动生效。',
30
+ '# 写法:修饰键(Ctrl/Alt/Shift/Win)+ 一个按键;鼠标侧键写 XButton1 / XButton2。',
31
+ '',
32
+ 'toggle = XButton1',
33
+ 'follow = Ctrl+Alt+`',
34
+ 'openMini = XButton2',
35
+ 'quit = Ctrl+Alt+Shift+Q',
36
+ '',
37
+ 'blockMouseButton = true',
38
+ '',
39
+ '# 跟随鼠标的鲸鱼:宽度 = 系统指针宽度 × whaleScale',
40
+ 'whaleScale = 3',
41
+ 'whaleOffsetX = 16',
42
+ 'whaleOffsetY = 16',
43
+ 'whaleImage = whale-alpha.png',
44
+ ''
45
+ ].join('\n')
46
+ }
47
+
48
+ function ensureAssets(targetDir) {
49
+ mkdirSync(targetDir, { recursive: true })
50
+ for (const file of ['DSH-Hotkey.exe', 'whale-alpha.png']) {
51
+ const source = join(PLUGIN_ROOT, 'app', file)
52
+ const target = join(targetDir, file)
53
+ if (!existsSync(source)) continue
54
+ try {
55
+ copyFileSync(source, target)
56
+ } catch {
57
+ // 目标可能正在运行(EBUSY):保持现有文件即可
58
+ }
59
+ }
60
+ const ini = join(targetDir, 'hotkey.ini')
61
+ if (!existsSync(ini)) {
62
+ try {
63
+ writeFileSync(ini, defaultIni(), 'utf8')
64
+ } catch {}
65
+ }
66
+ }
67
+
68
+ export function apply(ctx) {
69
+ if (process.platform !== 'win32') {
70
+ ctx.logger?.warn?.('dsh-cursor-whale: Windows only, skipped')
71
+ return
72
+ }
73
+
74
+ const dir = join(localAppData(), 'DSH-Hotkey')
75
+ const exe = join(dir, 'DSH-Hotkey.exe')
76
+
77
+ try {
78
+ ensureAssets(dir)
79
+ } catch {}
80
+
81
+ if (!existsSync(exe)) {
82
+ ctx.logger?.warn?.('dsh-cursor-whale: DSH-Hotkey.exe missing, run skipped')
83
+ return
84
+ }
85
+
86
+ try {
87
+ child = spawn(exe, [], { cwd: dir, windowsHide: true, stdio: 'ignore' })
88
+ child.on('exit', () => {
89
+ child = null
90
+ })
91
+ child.on('error', () => {
92
+ child = null
93
+ })
94
+ } catch {
95
+ child = null
96
+ }
97
+
98
+ ctx.effect(() => () => {
99
+ if (child && !child.killed) {
100
+ try {
101
+ child.kill()
102
+ } catch {}
103
+ child = null
104
+ }
105
+ })
106
+ }
package/locale/en.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "Cursor whale",
4
+ "description": "Collapses the dsh-mini popout into a small transparent whale that follows the cursor, and brings it back with the mouse forward button. Windows only; requires the dsh-mini plugin and a desktop DSH install.",
5
+ "detail": "docs/DETAIL.md"
6
+ }
7
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "meta": {
3
+ "title": "跟随鲸鱼",
4
+ "description": "把 dsh-mini 的小窗收成一只跟着鼠标走的透明鲸鱼,按鼠标前进键切回小窗、再按一次收回。仅 Windows;需要先装 dsh-mini 插件,并使用 DSH 桌面端。",
5
+ "detail": "docs/DETAIL.zh.md"
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "dsh-cursor-whale",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.1",
4
+ "type": "module",
5
+ "main": "lib/index.js",
6
+ "exports": {
7
+ ".": "./lib/index.js",
8
+ "./locale/*.json": "./locale/*.json"
9
+ },
10
+ "icon": "./icon.svg",
11
+ "files": [
12
+ "lib",
13
+ "app",
14
+ "locale",
15
+ "docs",
16
+ "src",
17
+ "assets",
18
+ "build.ps1",
19
+ "cordis.patch.yml",
20
+ "icon.svg",
21
+ "README.md",
22
+ "LICENSE"
23
+ ],
24
+ "description": "把 dsh-mini 的小窗收成跟着鼠标走的透明鲸鱼,鼠标前进键一键切回。Windows only.",
25
+ "keywords": [
26
+ "dsh",
27
+ "dsh-plugin",
28
+ "deepseek-harness",
29
+ "always-on-top",
30
+ "floating-window",
31
+ "whale"
32
+ ],
33
+ "os": [
34
+ "win32"
35
+ ],
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+https://github.com/ats-wee/dsh-cursor-whale.git"
40
+ },
41
+ "homepage": "https://github.com/ats-wee/dsh-cursor-whale#readme",
42
+ "bugs": {
43
+ "url": "https://github.com/ats-wee/dsh-cursor-whale/issues"
44
+ },
45
+ "dsh": {
46
+ "bundle": {
47
+ "patch": "./cordis.patch.yml"
48
+ }
49
+ }
6
50
  }