dsh-document-view 0.0.0-stage → 1.1.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/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # CHANGELOG
2
+
3
+ ## v1.1.1 (2026-11-15)
4
+
5
+ - 发布流程改为 npm trusted publishing(GitHub Actions OIDC),不再依赖会过期的 npm 令牌。
6
+ - 本版用于验证 trusted publisher 连接(npm 要求首次发布后连接才生效)。
7
+
8
+ ## v1.1.0 (2026-11-15)
9
+
10
+ - 文档:中英文双语 README、三张脱敏界面示意图、安全与隐私说明、兼容性说明、插件市场上架指南、目录条目模板。
11
+ - 展示:重写详情页 hero 插图;完善中英文 `meta.description`(功能、用法、隐私、兼容边界)。
12
+ - 代码:新增宿主契约检查与激活兜底,`client.js` 的 `apply()` 用 try/catch 包裹安装过程——DSH 升级导致内部结构变化时插件安全停用,不会拖垮页面。
13
+ - 核查:全仓敏感信息扫描确认无密钥 / 凭据 / 本机路径 / 外部 URL;`npm pack --dry-run` 核对发布清单。
14
+ - 确认当前运行与官方最新 release 同为 `0.2.2-rc.3`,并建立升级复核清单。
15
+
16
+ ## v1.0.0 (2026-11-15)
17
+
18
+ - 首个第三方可安装版本:从本机自用的原型抽出并重命名。
19
+ - 补齐 DSH 展示元数据(中英文 locale、图标、详情页)、MIT 许可与 GitHub README。
20
+ - 功能:文档居中 + 右侧会话、可拖动分栏、可选自动进入、窄屏切换、按会话保存;只改布局,不接管编辑 / 预览。
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-document-view 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.en.md ADDED
@@ -0,0 +1,134 @@
1
+ # dsh-document-view
2
+
3
+ **Read your document and talk to your AI at the same time.** A split document view for [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness): the document stays in the center, the current conversation stays on the right — no more tab hopping.
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![npm](https://img.shields.io/npm/v/dsh-document-view.svg)](https://www.npmjs.com/package/dsh-document-view)
7
+ [![DSH](https://img.shields.io/badge/DSH-0.2.2--rc.3-4c51bf.svg)](https://github.com/deepseek-ai/DeepSeek-Harness/releases/tag/dsh-v0.2.2-rc.3)
8
+
9
+ ![Document view: document in the center, conversation on the right](docs/screenshots/01-overview.png)
10
+
11
+ > Screenshots are **desensitized illustrations** with generic placeholder content. They contain no real sessions, file names, accounts, or personal data.
12
+
13
+ [中文说明 →](README.md) · [Marketplace submission guide →](docs/PUBLISHING.md) · [Compatibility & security →](docs/COMPATIBILITY.md)
14
+
15
+ ---
16
+
17
+ ## The problem
18
+
19
+ Open a file in DSH and it takes over the right sidebar, pushing your conversation away. Asking the AI to explain, summarize or rewrite against that document means constantly switching between "reading" and "chatting" — and losing context every time.
20
+
21
+ `dsh-document-view` does exactly one thing: **keeps both on screen**. It does not take over the editor, change save behavior, or touch your files. It only rearranges the window so DSH's native document / Office preview and the chat panel work side by side.
22
+
23
+ | | Default | Document view on |
24
+ | --- | --- | --- |
25
+ | Document | Takes the right sidebar | Center area |
26
+ | Conversation | Pushed away | Always visible on the right |
27
+ | Ask AI about the document | Switch back and forth | Same screen |
28
+ | Editing / saving / preview | Native | **Still native** |
29
+
30
+ ## Features
31
+
32
+ ### 1. Document and chat, side by side
33
+
34
+ ![Split view with a resizable divider](docs/screenshots/01-overview.png)
35
+
36
+ Open any file, then click **Document view** in the conversation header actions or the file tab actions. Drag the divider to resize; `←` / `→` nudge it, `Home` resets the ratio, and double-clicking the divider restores the default. The toggle and ratio are **saved per session**.
37
+
38
+ ### 2. Settings and auto-enter
39
+
40
+ ![Document view settings](docs/screenshots/02-settings.png)
41
+
42
+ The arrow next to the toggle opens settings:
43
+
44
+ - **Auto-enter on document view** (off by default) — fires only when *you* click a file or file tab; background file operations never open it. After you exit manually, the same file won't re-open repeatedly.
45
+ - **Document-first / Balanced / Chat-first** presets, saved per session.
46
+ - **Auto update / Paused** — reuses the host's native file watcher. Pause when you want to read carefully; resuming shows the latest content while preserving the native viewer's page and zoom state.
47
+
48
+ ### 3. Works in narrow windows
49
+
50
+ ![Document / Chat switch in a narrow window](docs/screenshots/03-narrow.png)
51
+
52
+ When the window is too narrow it switches to a single-column **Document / Chat** toggle. **Unsent input is preserved**, and focus moves to the visible switch if the current focus would be hidden.
53
+
54
+ ### 4. Native all the way down
55
+
56
+ Rendering, editing, saving and preview of Markdown, PDF, Word, Excel and PowerPoint remain entirely with DSH's own viewers and Office engine. The plugin **never reads, writes or uploads your files** and reimplements no editing feature. Disable it and the default layout returns.
57
+
58
+ ## Privacy & security
59
+
60
+ - **No network calls** — no `fetch`, `XMLHttpRequest`, `WebSocket`, no external URLs in the code.
61
+ - **No file access** — no filesystem or editor read/write APIs.
62
+ - **No credentials** — no API keys, tokens, passwords, cookies, `.env` or config files ship in the package.
63
+ - **One preference only** — browser `localStorage` holds the auto-enter toggle and per-session ratios under `dsh.document-view.v1`; no document content, paths, file names or chat content.
64
+ - **Narrow CSS scope** — all styles are scoped to the plugin's own `[data-fdc-*]` attributes. No host components are moved, cloned or remounted; only the window grid geometry changes.
65
+
66
+ See [SECURITY.md](SECURITY.md) and [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md).
67
+
68
+ ## Requirements
69
+
70
+ - [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) Desktop / Web, verified on **v0.2.2-rc.3** (the current official release).
71
+ - Node.js >= 20 — **only for rebuilding from source**; not needed to install or use.
72
+ - No `engines.dsh` hard constraint: a wrong constraint blocks installation outright, so compatibility is documented instead.
73
+
74
+ > The plugin relies on the host's DOM structure and slot names. If a DSH upgrade changes them, the plugin **disables itself safely and the page keeps working** (no white screen). Re-verify with the [upgrade checklist](docs/COMPATIBILITY.md).
75
+
76
+ ## Install
77
+
78
+ **Option 1 — local directory (easiest)**
79
+
80
+ ```sh
81
+ git clone https://github.com/Frank-Fan-1058/dsh-document-view.git
82
+ ```
83
+
84
+ Then in DSH: **Plugins → Add plugin**, pick the `dsh-document-view` directory, enable it, and refresh the page (or restart DSH).
85
+
86
+ **Option 2 — tarball**
87
+
88
+ ```sh
89
+ npm pack
90
+ ```
91
+
92
+ Extract `dsh-document-view-1.1.0.tgz` anywhere, then point step 2 of Option 1 at that directory.
93
+
94
+ **Option 3 — build from source**
95
+
96
+ ```sh
97
+ node scripts/build.mjs
98
+ ```
99
+
100
+ `src/` is the source; `client.js` is the self-contained build artifact (all CSS inlined, no runtime dependencies). **Rebuild `client.js` after any `src/` change** — don't hand-edit the artifact.
101
+
102
+ > `file:` dependencies are physical copies: after editing source, remove `node_modules/<package>` and reinstall so the running copy updates.
103
+
104
+ ## Usage
105
+
106
+ 1. Open a file in the right sidebar (Markdown / PDF / Office).
107
+ 2. Click **Document view** in the conversation header or file tab actions.
108
+ 3. Drag the divider; `←` / `→` to nudge, `Home` or double-click to reset.
109
+ 4. Open settings via the arrow for auto-enter and layout presets.
110
+ 5. Click the toggle again (or the exit entry in the session / file header) to return to the default layout.
111
+
112
+ ## FAQ
113
+
114
+ **Will it affect my editors or Office plugins?** No. It changes layout only — Univer, Office converters and native editors are untouched.
115
+
116
+ **Are my files read or uploaded?** No. No network requests, no file I/O, only the toggle and ratios are stored.
117
+
118
+ **Does anything remain after disabling?** No. All injected styles, attributes, the divider and listeners are removed on teardown.
119
+
120
+ **What if a DSH upgrade breaks it?** It disables itself safely and the page stays usable. Open an [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) with your DSH version.
121
+
122
+ **Which file types are supported?** Whatever the host supports natively — Markdown, PDF, Word, Excel, PowerPoint, etc. The plugin adds no format restrictions.
123
+
124
+ ## Get listed in plugin marketplaces
125
+
126
+ See **[docs/PUBLISHING.md](docs/PUBLISHING.md)** for the full playbook (1024 Store, dsh-market, the `dsh-plugin` GitHub topic, npm publishing, and a ready-to-use [catalog entry](docs/awesome-dsh-catalog-entry.json)).
127
+
128
+ ## Contributing
129
+
130
+ Issues and PRs welcome. Rebuild `client.js` when changing `src/`; update both `locale/en.json` and `locale/zh.json` when changing UI copy. Never put real sessions, file names, accounts or personal data into illustrations or examples.
131
+
132
+ ## License
133
+
134
+ [MIT](LICENSE) © 2026 dsh-document-view contributors
package/README.md CHANGED
@@ -1,3 +1,150 @@
1
- # Temporary Holding Version
1
+ # dsh-document-view
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
+ **边看文档,边聊 AI。** 给 [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) 加一个分栏视图:文档居中,当前会话留在右侧,不用再来回切换。
4
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
+ [![npm](https://img.shields.io/npm/v/dsh-document-view.svg)](https://www.npmjs.com/package/dsh-document-view)
7
+ [![DSH](https://img.shields.io/badge/DSH-0.2.2--rc.3-4c51bf.svg)](https://github.com/deepseek-ai/DeepSeek-Harness/releases/tag/dsh-v0.2.2-rc.3)
8
+ [![Platform](https://img.shields.io/badge/platform-Web%20%2F%20Desktop-lightgrey.svg)](#要求)
9
+
10
+ ![文档视图:中间是文档,右侧是当前会话](docs/screenshots/01-overview.png)
11
+
12
+ > 界面图为**脱敏示意图**,使用通用占位内容绘制,不含任何真实会话、文件名、账号或个人数据。
13
+
14
+ [English version →](README.en.md) · [插件市场上架指南 →](docs/PUBLISHING.md) · [兼容性与安全说明 →](docs/COMPATIBILITY.md)
15
+
16
+ ---
17
+
18
+ ## 为什么需要它
19
+
20
+ 在 DSH 里打开一个文件,文档会占满右侧栏,正在进行的对话被挤走。想让 AI 对照文档解释、总结、改写,就得在「看文档」和「看对话」之间反复切换,上下文一直在丢。
21
+
22
+ `dsh-document-view` 只做一件事:**把这两块同时留在屏幕上**。它不接管编辑器,不改动保存逻辑,也不碰你的文件——只是重新排布窗口,让已有的原生文档 / Office 预览和对话框并排工作。
23
+
24
+ | | 默认 | 开启文档视图后 |
25
+ | --- | --- | --- |
26
+ | 看文档 | 右侧栏独占 | 中间区域显示 |
27
+ | 当前对话 | 被挤走 / 需切回 | 右侧始终可见 |
28
+ | 让 AI 对照文档回答 | 来回切换 | 同屏完成 |
29
+ | 编辑、保存、预览 | 原生功能 | **仍是原生功能** |
30
+
31
+ ## 核心能力
32
+
33
+ ### 1. 文档与对话同屏
34
+
35
+ ![分栏与可调分隔线](docs/screenshots/01-overview.png)
36
+
37
+ 打开任意文件后,在会话头部或文件标签的操作区点 **「文档视图」** 即可开启。拖动中间的分隔线调整宽度,也可以用 `←` / `→` 微调、`Home` 复位、双击分隔线恢复默认比例。开关和比例**按会话分别记住**。
38
+
39
+ ### 2. 设置与自动进入
40
+
41
+ ![文档视图设置](docs/screenshots/02-settings.png)
42
+
43
+ 开关旁边的箭头打开设置:
44
+
45
+ - **查看文档时自动进入**(默认关闭):只在你主动点击文件或文件标签时触发,后台文件操作不会打扰你;手动退出后,同一个文件不会反复自动打开。
46
+ - **文档优先 / 均衡 / 对话优先** 三种预设,按会话保存。
47
+ - **自动更新 / 已暂停**:沿用宿主原生的文件变化监听,需要仔细阅读时可暂停跟随,继续后显示最新内容,并保留原生预览的页码与缩放状态。
48
+
49
+ ### 3. 窄窗口也能用
50
+
51
+ ![窄窗口下的文档 / 对话切换](docs/screenshots/03-narrow.png)
52
+
53
+ 窗口不够宽时自动切换为「文档 / 对话」单栏切换,**未发送的输入不会丢**;宽转窄时若焦点落在即将隐藏的区域,会移到可见的切换按钮上。
54
+
55
+ ### 4. 只用原生能力
56
+
57
+ Markdown、PDF、Word、Excel、PPT 的渲染、编辑、保存与预览,全部继续由 DSH 自带的查看器和 Office 引擎负责。本插件**不读取、不写入、不上传**你的文件,也不重复实现任何编辑功能。停用插件即恢复默认布局。
58
+
59
+ ## 隐私与安全
60
+
61
+ 这一点值得单独说清楚,因为插件会接触你的工作界面:
62
+
63
+ - **零网络请求**:代码里没有 `fetch`、`XMLHttpRequest`、`WebSocket`,也没有任何外部 URL。
64
+ - **零文件访问**:不调用任何读写文件的接口,不碰编辑器内容。
65
+ - **零凭据**:包内不含 API Key、Token、密码、Cookie 或任何密钥;没有 `.env`、没有配置文件。
66
+ - **只存一项偏好**:用浏览器 `localStorage` 保存「自动进入开关 + 每个会话的分栏比例」,键名 `dsh.document-view.v1`,不保存文档内容、路径、文件名或对话内容。
67
+ - **作用域收窄**:所有样式都限定在插件自己加的 `[data-fdc-*]` 属性下,不改宿主全局样式;不移动、不克隆、不重新挂载任何 React 组件,只调整窗口网格的几何尺寸。
68
+
69
+ 详见 [SECURITY.md](SECURITY.md) 与 [docs/COMPATIBILITY.md](docs/COMPATIBILITY.md)。
70
+
71
+ ## 要求
72
+
73
+ - [DeepSeek Harness](https://github.com/deepseek-ai/DeepSeek-Harness) 桌面版 / Web 版,**v0.2.2-rc.3**(当前官方最新 release)上验证通过。
74
+ - Node.js >= 20 —— **仅从源码重建时需要**;单纯安装使用不需要 Node.js。
75
+ - 不设 `engines.dsh` 硬约束:版本约束写错会直接阻止安装,兼容性声明放在本文档与 [兼容性说明](docs/COMPATIBILITY.md)。
76
+
77
+ > 插件依赖宿主的 DOM 结构与 slot 名称。DSH 升级后若这些内部结构变化,插件会**自动停用并保持页面可用**(不会白屏),随后按 [升级复核清单](docs/COMPATIBILITY.md#升级复核清单) 重验即可。
78
+
79
+ ## 安装
80
+
81
+ **方式零:从 npm 安装(已发布,解锁一键安装)**
82
+
83
+ ```sh
84
+ # 1024 Store 的安装方式
85
+ dsh1024 plugin --profile web add dsh-document-view
86
+
87
+ # 或直接走官方 CLI
88
+ dsh plugin --profile web add dsh-document-view
89
+ ```
90
+
91
+ 包地址:https://www.npmjs.com/package/dsh-document-view
92
+
93
+ **方式一:本地目录安装(最简单)**
94
+
95
+ ```sh
96
+ git clone https://github.com/Frank-Fan-1058/dsh-document-view.git
97
+ ```
98
+
99
+ 然后打开 DSH → **插件 → 添加插件**,选中 `dsh-document-view` 目录 → 在插件列表启用 → 刷新页面(或重启 DSH)。
100
+
101
+ **方式二:打包成 tarball**
102
+
103
+ ```sh
104
+ npm pack
105
+ ```
106
+
107
+ 把生成的 `dsh-document-view-1.1.0.tgz` 解压到任意目录,再按方式一第 2 步指向该目录。
108
+
109
+ **方式三:从源码构建**
110
+
111
+ ```sh
112
+ npm install # 仅构建时需要
113
+ node scripts/build.mjs
114
+ ```
115
+
116
+ `src/` 是源码,`client.js` 是自包含构建产物(内联全部 CSS,无运行时依赖)。**改了 `src/` 必须重建** `client.js`,不要手改产物。
117
+
118
+ > `file:` 依赖是实体拷贝:改了源码要删掉 `node_modules/<包名>` 再重装,运行副本才会更新。
119
+
120
+ ## 使用
121
+
122
+ 1. 在右侧栏打开一个文件(Markdown / PDF / Office 均可)。
123
+ 2. 点会话头部或文件标签上的 **「文档视图」**。
124
+ 3. 拖动分隔线调宽度;`←` / `→` 微调,`Home` 或双击分隔线复位。
125
+ 4. 点开关旁的箭头进设置,按需开启「自动进入」或选布局预设。
126
+ 5. 再点一次开关(或会话顶部 / 文件顶部的退出入口)即可退出,恢复默认布局。
127
+
128
+ ## 常见问题
129
+
130
+ **会影响我已有的文档编辑器或 Office 插件吗?** 不会。本插件不改 Univer、Office 转换服务或任何原生编辑器,只调整窗口布局。
131
+
132
+ **我的文件会被读取或上传吗?** 不会。插件不发网络请求、不读写文件,只保存开关与比例两项偏好。
133
+
134
+ **关掉插件后布局会残留吗?** 不会。卸载时会移除所有注入的样式、属性、分隔线与监听,恢复宿主原生布局。
135
+
136
+ **升级 DSH 后失效了怎么办?** 插件会安全地自动停用(页面照常可用)。请提 [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) 并附上 DSH 版本,维护者按 [升级复核清单](docs/COMPATIBILITY.md#升级复核清单) 适配。
137
+
138
+ **支持哪些文件类型?** 宿主原生支持什么就支持什么:Markdown、PDF、Word、Excel、PPT 等,本插件不做格式限制。
139
+
140
+ ## 上架插件市场
141
+
142
+ 想让更多人在 DSH 内直接搜到并安装?完整流程(含 1024 Store / dsh-market 的收录方式、`dsh-plugin` topic、npm 发布、目录 PR 模板)见 **[docs/PUBLISHING.md](docs/PUBLISHING.md)**。仓库内已备好可直接复用的 [目录条目](docs/awesome-dsh-catalog-entry.json)。
143
+
144
+ ## 参与贡献
145
+
146
+ 欢迎提 [Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) 与 PR。改 `src/` 后请一并提交重建后的 `client.js`;涉及界面文案时同步更新 `locale/en.json` 与 `locale/zh.json`。请勿在示意图或示例中放入真实会话、文件名、账号或个人数据。
147
+
148
+ ## 许可证
149
+
150
+ [MIT](LICENSE) © 2026 dsh-document-view contributors
package/SECURITY.md ADDED
@@ -0,0 +1,27 @@
1
+ # Security & privacy
2
+
3
+ `dsh-document-view` is a layout-only client bundle. The following claims are verifiable from the source (`src/`, `client.js`, `index.js`):
4
+
5
+ | Concern | Status |
6
+ | --- | --- |
7
+ | Network requests | None — no `fetch`, `XMLHttpRequest`, `WebSocket`, `EventSource`, or external URLs |
8
+ | File I/O | None — no filesystem or editor read/write APIs |
9
+ | Credentials | None — no API keys, tokens, passwords, cookies, `.env`, or config files in the package |
10
+ | Data stored | One `localStorage` entry `dsh.document-view.v1`: the auto-enter flag and per-session column ratios |
11
+ | Data not stored | Document content, file paths, file names, chat content, account data |
12
+ | Host modification | CSS is scoped to the plugin's own `[data-fdc-*]` attributes; no host React nodes are moved, cloned or remounted |
13
+ | Teardown | Removes all injected styles, attributes, divider, observers and listeners on disable |
14
+
15
+ The only URLs in the repository are documentation links in the README, the `docs/` guides, and the public `repository` / `bugs` / `homepage` fields in `package.json`.
16
+
17
+ ## Reporting a vulnerability
18
+
19
+ Open a [GitHub Issue](https://github.com/Frank-Fan-1058/dsh-document-view/issues) with a description and reproduction steps. For a privately disclosed issue, use GitHub's private vulnerability reporting on the repository's **Security** tab.
20
+
21
+ ## Verifying the shipped files
22
+
23
+ ```sh
24
+ npm pack --dry-run # inspect the exact published file list
25
+ ```
26
+
27
+ `files` in `package.json` is a whitelist; development-only documents (`AGENTS.md`, `PROJECT.md`, `临时/`, `归档/`) are not part of the package.