dsh-long-plugins 1.3.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 +21 -0
- package/README.md +129 -0
- package/client/client.js +2821 -0
- package/client/vendor/chart.umd.min.js +20 -0
- package/client/vendor/docx-preview.min.js +8 -0
- package/client/vendor/jszip.min.js +13 -0
- package/client/vendor/pptxviewjs.min.js +1 -0
- package/cordis.patch.yml +12 -0
- package/dsh.plugin.json +14 -0
- package/lib/index.js +2027 -0
- package/lib/md2docx.py +210 -0
- package/package.json +58 -0
- package/patches/dsh-client-connection-heartbeat.sh +107 -0
- package/skill/dsh-common-plugins-install/SKILL.md +128 -0
- package/skill/dsh-long-plugins-install/SKILL.md +200 -0
- package/skill/dsh-upgrade/SKILL.md +89 -0
- package/skill/dsh-web-start-panel-install/SKILL.md +349 -0
- package/skill/dsh-web-win-service-install/SKILL.md +243 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jackylong1987
|
|
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,129 @@
|
|
|
1
|
+
# dsh-long-plugins
|
|
2
|
+
|
|
3
|
+
Merged plugin bundle for [DeepSeek Harness](https://github.com/deepseek-ai/dsh) (DSH) Web:
|
|
4
|
+
upload manager, workspace **输出文件** section, top-bar **文件** browser with a real Word (docx) preview,
|
|
5
|
+
**技能文档** (skill docs) browser, and DeepSeek account balance — all in one installable plugin.
|
|
6
|
+
Also ships an auto-repair install that relinks DSH core patches (reverse-proxy WebSocket heartbeat, upgrade relink).
|
|
7
|
+
|
|
8
|
+
一个插件整合 DSH Web 的常用增强:上传管理、顶栏「📂文件」工作区浏览 + Word 真实预览、工作区「输出文件」面板、技能文档浏览、账户余额显示。并自带修复安装,自动重连 DSH 核心补丁(反代 WebSocket 心跳、升级重连)。
|
|
9
|
+
|
|
10
|
+
## Features / 功能
|
|
11
|
+
|
|
12
|
+
| Feature | 说明 |
|
|
13
|
+
|---|---|
|
|
14
|
+
| Upload manager | 输入框回形针按钮上传本地文件,待发送文件栏管理,设置面板「上传文件」(预览/下载/删除) |
|
|
15
|
+
| Workspace output files | 设置面板「输出文件」:按工作区文件夹分组、预览、**编辑/保存**、复制全部、**放大窗口** |
|
|
16
|
+
| Workspace file browser (顶栏「📂文件」) | 顶栏「📂文件」打开工作区/全部文件浏览,按文件夹分组;点文件名或「预览」在面板内预览,**Word (.docx) 用 docx-preview 浏览器端真实渲染(所见即所得)**;支持「←返回」「✕关闭」两层退出回列表,底部仅列表根时才整体退出;含下载/放大 |
|
|
17
|
+
| Skill docs | 设置面板「技能文档」:按技能目录浏览 SKILL.md、弹窗预览、编辑/保存、复制、放大窗口 |
|
|
18
|
+
| Account balance | 输入框下方显示 DeepSeek 账户余额(60s 自动刷新) |
|
|
19
|
+
| md2docx | DSH 工具:把 Markdown 一键转成带页码页脚的 Word(`.docx`),标题/表格/加粗/列表/引用,生成的文件作为可点击交付物出现在消息里 |
|
|
20
|
+
| Turn ruler | 会话右侧轮次导航:3 个比例刻度(最早/中间/最新)+ 预览窗列出全部轮次标题,光标点亮、点击蓝色标记并定位会话,滚到顶部自动加载更早历史,手机端竖向把手打开预览窗 |
|
|
21
|
+
| Auto-repair install | 安装时自动重打 DSH 核心补丁:反代 WebSocket 心跳(修复提问窗口自己消失)、升级后重连 |
|
|
22
|
+
| Mobile layout | 手机端布局优化(输入栏、设置面板、主题选择、模型选择器) |
|
|
23
|
+
| Drag & drop upload | 拖任意文件到会话框直接附加为「待发送」卡片(走与回形针同一上传管线);全屏虚线投掷遮罩提示;消除 DSH 核心"仅支持 PNG/JPG/WebP/GIF 格式的图片"误报 |
|
|
24
|
+
|
|
25
|
+
## 更新记录 / Releases
|
|
26
|
+
|
|
27
|
+
### v1.3.1
|
|
28
|
+
|
|
29
|
+
**新增 · 顶栏「📂 文件」工作区浏览器 + Word 真实预览**:顶栏「📂文件」打开工作区/全部文件浏览,按文件夹分组;点文件名或「预览」在面板内预览。Word(`.docx`)走 `docx-preview` 浏览器端真实渲染(所见即所得,无需服务端转换),并随包打包前端库 `client/vendor`(docx-preview / jszip)。
|
|
30
|
+
|
|
31
|
+
**优化 · 两层关闭**:预览某文件时「✕关闭」/ Esc / 预览页自带「关闭」都回到文件列表,仅列表根部才整体退出面板;头部新增「←返回」按钮。Word 预览页也补上自带「✕关闭」,与 md 预览一致的两层关闭。
|
|
32
|
+
|
|
33
|
+
### v1.3.0
|
|
34
|
+
|
|
35
|
+
**新增 · 拖放上传**:拖文件到网页任意位置松手即附加为「待发送」卡片;支持 `md / docx / xlsx / pptx / pdf / txt / csv` 及 `png / jpg / webp / gif`;与回形针同一条上传管线;拖放时全屏虚线投掷遮罩。
|
|
36
|
+
|
|
37
|
+
**🐛 修复**:消除核心"仅支持 PNG/JPG/WebP/GIF"误报——捕获阶段接管文件拖放。
|
|
38
|
+
|
|
39
|
+
**兼容性**:仅对真正拖入文件生效;拖文本/链接不受影响;标准浏览器事件,多设备通用。
|
|
40
|
+
|
|
41
|
+
## Turn ruler / 轮次导航
|
|
42
|
+
|
|
43
|
+
- 桌面端:会话右侧 3 个比例刻度点,悬停打开「历史提问」预览窗
|
|
44
|
+
- 预览窗:列出全部已加载轮次的标题;光标悬停点亮该行,点击行以蓝色标记并定位主会话
|
|
45
|
+
- 滚动到预览窗顶部自动加载更早历史(内容锚定恢复焦点,无震动、不跳跃);手机端触摸滚动已做性能优化
|
|
46
|
+
- 手机端:右边缘竖向把手点击打开预览窗(居中弹窗,✕ 关闭)
|
|
47
|
+
|
|
48
|
+
## Install / 安装
|
|
49
|
+
|
|
50
|
+
> **目录约定**:插件放 `$DSH_HOME/plugins/dsh-long-plugins`,DSH 运行脚本(`bin`)放 `$DSH_HOME/bin`,都别放工作目录。你的**工作目录**(名字任意)由用户指定,其下 `upload` 为上传根(`DSH_UPLOAD_DIR`)。目录缺失用 `mkdir -p` 补建。
|
|
51
|
+
|
|
52
|
+
### 方式 A:`install.sh`(Unix/Linux/NAS)
|
|
53
|
+
```sh
|
|
54
|
+
git clone https://github.com/jackylong1987/dsh-long-plugins.git "$HOME/.dsh/plugins/dsh-long-plugins"
|
|
55
|
+
cd "$HOME/.dsh/plugins/dsh-long-plugins"
|
|
56
|
+
./install.sh web "$HOME/.dsh" "$HOME/.dsh/plugins/dsh-long-plugins"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 方式 B:Windows(PowerShell)
|
|
60
|
+
```powershell
|
|
61
|
+
git clone https://github.com/jackylong1987/dsh-long-plugins.git "$env:USERPROFILE\.dsh\plugins\dsh-long-plugins"
|
|
62
|
+
dsh plugin --profile web add "file:$env:USERPROFILE\.dsh\plugins\dsh-long-plugins"
|
|
63
|
+
# 把 "dsh-long-plugins" 追加到 profile package.json 的 dsh.profile.bundles
|
|
64
|
+
```
|
|
65
|
+
Windows 不跑 `install.sh`,skill 需手动放到 `$env:USERPROFILE\.dsh\skills\`。
|
|
66
|
+
|
|
67
|
+
### 方式 C:用 skill 安装(推荐)
|
|
68
|
+
前置把 skill 放进 `$DSH_HOME/skills/`。之后在 DSH 会话中:安装 `dsh-long-plugins`,agent 按 skill 指引自动完成。
|
|
69
|
+
|
|
70
|
+
### 手动
|
|
71
|
+
在 `<DSH_HOME>/profiles/<profile>/package.json` 加 `file:` 依赖与 bundle,然后 `pnpm install`:
|
|
72
|
+
```json
|
|
73
|
+
{ "dependencies": { "dsh-long-plugins": "file:/home/me/.dsh/plugins/dsh-long-plugins" }, "dsh": { "profile": { "bundles": ["dsh-long-plugins"] } } }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 工作目录 / 上传目录
|
|
77
|
+
按你的工作目录设上传根(目录缺失 `mkdir -p` 补建),并写进启动脚本、确认可写:
|
|
78
|
+
```sh
|
|
79
|
+
mkdir -p "/home/me/project/upload"
|
|
80
|
+
export DSH_UPLOAD_DIR="/home/me/project/upload" # 工作区根 = /home/me/project
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Configuration / 配置
|
|
84
|
+
|
|
85
|
+
Add to the profile's `cordis.patch.yml`:
|
|
86
|
+
|
|
87
|
+
```yaml
|
|
88
|
+
- id: dsh-long-plugins
|
|
89
|
+
config:
|
|
90
|
+
priority: -10
|
|
91
|
+
trustedHosts: !!js ctx.webRuntime.trustedHosts
|
|
92
|
+
skillsRoot: !!js dshHomePath('skills') # default <DSH_HOME>/skills; override with your path
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- `trustedHosts` — required for the browser trust fence (same as the built-in Web API).
|
|
96
|
+
- `skillsRoot` — root directory browsed by the「技能文档」section. Defaults to `<DSH_HOME>/skills`.
|
|
97
|
+
- `md2docxScript` — (optional) override the Markdown→Word script path. Defaults to the bundled `lib/md2docx.py`.
|
|
98
|
+
|
|
99
|
+
## md2docx 工具(Markdown → Word)
|
|
100
|
+
|
|
101
|
+
Agent 可直接调用 `md2docx` 工具,把 Markdown 转成带页码页脚的 Word 文档:
|
|
102
|
+
|
|
103
|
+
- 输入 `input`(必填):`.md` 文件绝对路径。
|
|
104
|
+
- 输出 `output`(可选):`.docx` 路径;缺省为同目录同名 `.docx`。
|
|
105
|
+
- 生成的文件会作为可点击交付物卡片出现在消息里(复用插件内置预览/打开链路)。
|
|
106
|
+
|
|
107
|
+
**前置依赖:** 宿主需安装 `python3` 与 `python-docx`(`pip install python-docx`)。转换脚本随包分发(`lib/md2docx.py`),无需额外安装脚本;也无需 pandoc。
|
|
108
|
+
|
|
109
|
+
## Server routes / 服务端路由
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
/api/dsh-uploads/workspace output files (grouped by folder)
|
|
113
|
+
/api/dsh-uploads/workspace-browse workspace file browser (top-bar「📂文件」)
|
|
114
|
+
/api/dsh-uploads/workspace-file preview / download
|
|
115
|
+
/api/dsh-uploads/workspace-file/delete delete (POST)
|
|
116
|
+
/api/dsh-uploads/workspace-file/save save edited content (POST)
|
|
117
|
+
/api/dsh-uploads/docx-preview Word (.docx) real render page (browser-side docx-preview)
|
|
118
|
+
/api/dsh-uploads/docx-preview-asset serve docx-preview / jszip vendor libs
|
|
119
|
+
/dsh-skill-docs/skill-docs skill docs list (grouped by skill)
|
|
120
|
+
/dsh-skill-docs/skill-doc preview / download
|
|
121
|
+
/dsh-skill-docs/skill-doc/save save (POST)
|
|
122
|
+
/dsh-token-usage/balance DeepSeek account balance proxy
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Plus the upload manager's core routes (`/api/dsh-uploads`, download, preview).
|
|
126
|
+
|
|
127
|
+
## License
|
|
128
|
+
|
|
129
|
+
MIT
|