@jaxzhou/dsh-file-explorer 0.1.8 → 0.1.10
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/README.md +29 -17
- package/{README.zh.md → docs/README.zh.md} +25 -14
- package/lib/client.js +479 -374
- package/lib/client.js.map +1 -1
- package/package.json +12 -12
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@jaxzhou/dsh-file-explorer)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
|
|
6
|
-
English | [中文](README.zh.md)
|
|
6
|
+
English | [中文](docs/README.zh.md)
|
|
7
7
|
|
|
8
8
|
> Published on npm as **`@jaxzhou/dsh-file-explorer`** — the unscoped name
|
|
9
9
|
> `dsh-file-explorer` belongs to a different author's plugin.
|
|
@@ -38,7 +38,11 @@ which no export does now.
|
|
|
38
38
|
|
|
39
39
|
The left pane is the session's working directory, listed one level at a time,
|
|
40
40
|
directories first. An expanded level stays expanded while you move between
|
|
41
|
-
preview tabs
|
|
41
|
+
preview tabs, and the pane itself folds away — by its own control, or by opening
|
|
42
|
+
a file. That last one is also how the pane behaves on a phone: below 720 pixels
|
|
43
|
+
the tree and the preview take turns instead of sharing a width neither of them
|
|
44
|
+
fits in, and a finger gets bigger controls, a taller header, and a tab close
|
|
45
|
+
button that is not waiting for a hover it will never see.
|
|
42
46
|
|
|
43
47
|
Clicking a file opens it in a tab, so several files stay open at once — each with
|
|
44
48
|
its own body and its own wrap setting. A file that is already open is focused
|
|
@@ -55,7 +59,7 @@ The right pane picks each tab's body from the file:
|
|
|
55
59
|
| **Source code** | Syntax highlighting, line numbers, and a copy button for 24 grammars: TypeScript/JavaScript, shell, Python, Ruby, Go, Rust, Java, C, C++, C#, Kotlin, Swift, PHP, YAML, TOML, INI, HTML, CSS, SCSS, Less, SQL, XML, Lua, MDX |
|
|
56
60
|
| **Images** | PNG, JPEG, GIF, WebP, AVIF, BMP, ICO and SVG, drawn to the pane. An SVG goes through `<img>`, so its scripts never run |
|
|
57
61
|
| **PDF** | Drawn by the browser's own PDF reader, from the file's bytes — so its text is real text |
|
|
58
|
-
| **Word, Excel, PowerPoint** | `.docx`, `.xlsx` and `.pptx` unpacked in the page: a document's headings, lists, quotes, tables, pictures and code, with each run's
|
|
62
|
+
| **Word, Excel, PowerPoint** | `.docx`, `.xlsx` and `.pptx` unpacked in the page: a document's headings, lists, quotes, tables, pictures and code, drawn with the formatting the document itself carries — each run's **font, size**, bold, italic, underline, strikethrough, super- and subscript, colour and highlight, and each paragraph's alignment, indents and spacing, all read through its style chain rather than off the run; a workbook's sheets as a grid, with the dates it stores as numbers shown as dates; a deck's slides as an outline of their text and pictures |
|
|
59
63
|
| **Anything else** | Numbered plain text — an unmapped suffix (`.vue`, `.proto`, `.txt`) stays plain rather than guessing a wrong grammar. The legacy binary Office formats (`.doc`, `.xls`, `.ppt`) are not previewed: the pane says so and offers the download |
|
|
60
64
|
|
|
61
65
|
A **Mermaid** code fence (` ```mermaid `) is a diagram, not source, so the pane
|
|
@@ -98,10 +102,14 @@ beside it, and the images and stylesheets an HTML file links to.
|
|
|
98
102
|
|
|
99
103
|
## Requirements
|
|
100
104
|
|
|
101
|
-
DeepSeek Harness **0.1.5-rc.2** on the **Web** surface — `dsh web`,
|
|
102
|
-
composed from `@deepseek-ai/dsh-base` + `@deepseek-ai/dsh-web-app`. A
|
|
103
|
-
SDK profile has no browser and gets no tab. The plugin declares no
|
|
104
|
-
so nothing in `cordis.yml` needs setting.
|
|
105
|
+
DeepSeek Harness **0.1.5-rc.2** or **0.2.0-rc.2** on the **Web** surface — `dsh web`,
|
|
106
|
+
or a profile composed from `@deepseek-ai/dsh-base` + `@deepseek-ai/dsh-web-app`. A
|
|
107
|
+
headless or SDK profile has no browser and gets no tab. The plugin declares no
|
|
108
|
+
configuration, so nothing in `cordis.yml` needs setting.
|
|
109
|
+
|
|
110
|
+
One artifact serves both: 0.2.0 renamed the shared icon set and reshaped the byte
|
|
111
|
+
read, so the plugin asks the running shell which spelling and which shape it has
|
|
112
|
+
(see `src/client/shell.ts`) rather than assuming either.
|
|
105
113
|
|
|
106
114
|
## Install
|
|
107
115
|
|
|
@@ -110,10 +118,11 @@ dsh plugin --profile web add @jaxzhou/dsh-file-explorer
|
|
|
110
118
|
dsh --profile web # bundle membership is read at startup
|
|
111
119
|
```
|
|
112
120
|
|
|
113
|
-
A custom profile needs the Web composition first
|
|
121
|
+
A custom profile needs the Web composition first. `--from-default-profile` creates
|
|
122
|
+
the profile *and* boots it, so stop the first command once it prints its URL:
|
|
114
123
|
|
|
115
124
|
```sh
|
|
116
|
-
dsh --profile myprofile --from-default-profile web
|
|
125
|
+
dsh --profile myprofile --from-default-profile web # creates it, then serves it
|
|
117
126
|
dsh plugin --profile myprofile add @jaxzhou/dsh-file-explorer
|
|
118
127
|
dsh --profile myprofile
|
|
119
128
|
```
|
|
@@ -202,14 +211,17 @@ restart the profile.
|
|
|
202
211
|
diagram types Mermaid 11 carries; a malformed one keeps its source and names
|
|
203
212
|
the failure above it.
|
|
204
213
|
- **An Office preview is content, not layout.** A `.docx` shows its headings,
|
|
205
|
-
lists, quotes, tables and pictures, and the
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
214
|
+
lists, quotes, tables and pictures, and the formatting the document carries:
|
|
215
|
+
each run's font, size, weight, underline, strikethrough, super- and subscript,
|
|
216
|
+
colour and highlight, and each paragraph's alignment, indents and spacing —
|
|
217
|
+
resolved through the document's style chain, so text that is styled by a
|
|
218
|
+
*style* rather than by the run is drawn the way the document means it. What is
|
|
219
|
+
*not* there is everything that needs a layout engine: columns and page breaks,
|
|
220
|
+
headers and footers, table borders and shading, text boxes, charts, SmartArt,
|
|
221
|
+
and animations. A *theme* font is not resolved either — a run that names a
|
|
222
|
+
theme gets the page's own default rather than a guess at what the theme says.
|
|
223
|
+
A `.xlsx` shows its cells' values; a `.pptx` shows each slide's text and
|
|
224
|
+
pictures. Formulas show the value the file cached, not a recalculation.
|
|
213
225
|
- **Only the OOXML formats are read.** `.doc`, `.xls` and `.ppt` are the older
|
|
214
226
|
binary container, which this pane does not parse — it says so and offers the
|
|
215
227
|
download instead.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# dsh-file-explorer
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@jaxzhou/dsh-file-explorer)
|
|
4
|
-
[](LICENSE)
|
|
4
|
+
[](../LICENSE)
|
|
5
5
|
|
|
6
|
-
[English](README.md) | 中文
|
|
6
|
+
[English](../README.md) | 中文
|
|
7
7
|
|
|
8
8
|
> npm 包名是 **`@jaxzhou/dsh-file-explorer`** —— 无作用域的 `dsh-file-explorer`
|
|
9
9
|
> 属于另一位作者的插件。
|
|
@@ -21,7 +21,7 @@ dsh --profile web
|
|
|
21
21
|
|
|
22
22
|
## 演示
|
|
23
23
|
|
|
24
|
-
[](media/demo.mp4)
|
|
24
|
+
[](../media/demo.mp4)
|
|
25
25
|
|
|
26
26
|
*15 秒录屏 —— 点击可打开完整画质的 MP4。* 一个小数学工作区:渲染后的讲义文档
|
|
27
27
|
(含表格)、切到 **源码** 看它背后的 Markdown、在旁边用另一个标签打开第二份文档,
|
|
@@ -34,6 +34,10 @@ dsh --profile web
|
|
|
34
34
|
## 能做什么
|
|
35
35
|
|
|
36
36
|
左栏是会话的工作目录,逐层展开,目录在前;展开过的层级在切换预览标签后仍然保持。
|
|
37
|
+
左栏本身也可以收起 —— 用它的开关,或者直接点开一个文件。后者也是窄屏上的行为:宽度
|
|
38
|
+
低于 720 像素时,目录树与预览**轮流占满**,而不是挤在一个谁都放不下的宽度里;同时
|
|
39
|
+
触摸设备会得到更大的控件、更高的表头,以及一个不再依赖 hover(触摸屏上永远不会发生)
|
|
40
|
+
的标签关闭按钮。
|
|
37
41
|
|
|
38
42
|
点击文件会在标签中打开它,因此可以同时打开多个文件——每个标签有自己的预览体、
|
|
39
43
|
自己的换行设置。已打开的文件会被聚焦而不是重复打开;同名的标签会带上所在目录;
|
|
@@ -49,7 +53,7 @@ dsh --profile web
|
|
|
49
53
|
| **源码** | 24 种语法的语法高亮、行号与复制按钮:TypeScript/JavaScript、shell、Python、Ruby、Go、Rust、Java、C、C++、C#、Kotlin、Swift、PHP、YAML、TOML、INI、HTML、CSS、SCSS、Less、SQL、XML、Lua、MDX |
|
|
50
54
|
| **图片** | PNG、JPEG、GIF、WebP、AVIF、BMP、ICO、SVG,自动适配窗格。SVG 经 `<img>` 绘制,其中的脚本不会执行 |
|
|
51
55
|
| **PDF** | 交由浏览器自带的 PDF 阅读器绘制,用的是文件自身的字节 —— 因此其中的文字是真文字 |
|
|
52
|
-
| **Word / Excel / PowerPoint** | `.docx`、`.xlsx`、`.pptx`
|
|
56
|
+
| **Word / Excel / PowerPoint** | `.docx`、`.xlsx`、`.pptx` 在页面内解包:文档的标题、列表、引用、表格、图片与代码,并按**文档自身的格式**绘制——每段文字的**字体、字号**、粗体、斜体、下划线、删除线、上/下标、颜色与高亮,以及每个段落的对齐、缩进与间距,全部经**样式级联**解析而不是只看 run 上写了什么;工作簿按工作表显示为网格,并以日期显示它按数字存储的日期;演示文稿按幻灯片显示其文字与图片的提纲 |
|
|
53
57
|
| **其它** | 带行号的纯文本 —— 未映射的后缀(`.vue`、`.proto`、`.txt`)保持纯文本,而不是猜测一个错误的高亮。旧版二进制 Office 格式(`.doc`、`.xls`、`.ppt`)不做预览:窗格会说明原因并提供下载 |
|
|
54
58
|
|
|
55
59
|
**Mermaid** 代码围栏(` ```mermaid `)是图表而不是源码,窗格会把它画出来:
|
|
@@ -85,11 +89,15 @@ Markdown 源码。
|
|
|
85
89
|
|
|
86
90
|
## 环境要求
|
|
87
91
|
|
|
88
|
-
DeepSeek Harness **0.1.5-rc.2** 的 **Web** 界面 —— `dsh web`,或由
|
|
92
|
+
DeepSeek Harness **0.1.5-rc.2** 或 **0.2.0-rc.2** 的 **Web** 界面 —— `dsh web`,或由
|
|
89
93
|
`@deepseek-ai/dsh-base` + `@deepseek-ai/dsh-web-app` 组合出的 profile。headless
|
|
90
94
|
或 SDK profile 没有浏览器,不会出现该标签。插件没有配置项,`cordis.yml` 无需
|
|
91
95
|
任何设置。
|
|
92
96
|
|
|
97
|
+
同一份产物同时适配两者:0.2.0 重命名了共享图标集,并改写了字节读取的形状,
|
|
98
|
+
因此插件会先问运行中的 shell 用的是哪种拼写、哪种形状(见 `src/client/shell.ts`),
|
|
99
|
+
而不是假定其中一种。
|
|
100
|
+
|
|
93
101
|
## 安装
|
|
94
102
|
|
|
95
103
|
```sh
|
|
@@ -97,10 +105,11 @@ dsh plugin --profile web add @jaxzhou/dsh-file-explorer
|
|
|
97
105
|
dsh --profile web # bundle 成员在启动时读取
|
|
98
106
|
```
|
|
99
107
|
|
|
100
|
-
自定义 profile 需要先具备 Web
|
|
108
|
+
自定义 profile 需要先具备 Web 组合。`--from-default-profile` 会在创建 profile 后
|
|
109
|
+
直接启动它,因此第一条命令打印出地址后先停掉:
|
|
101
110
|
|
|
102
111
|
```sh
|
|
103
|
-
dsh --profile myprofile --from-default-profile web
|
|
112
|
+
dsh --profile myprofile --from-default-profile web # 先创建,随后启动服务
|
|
104
113
|
dsh plugin --profile myprofile add @jaxzhou/dsh-file-explorer
|
|
105
114
|
dsh --profile myprofile
|
|
106
115
|
```
|
|
@@ -173,11 +182,13 @@ profile。
|
|
|
173
182
|
其中的标签不可选中,且始终以白底绘制:PDF 页面与 Word 文档都是白底,为深色窗格
|
|
174
183
|
绘制的图在它们上面会看不见。绘制范围是 Mermaid 11 支持的图表类型;语法错误的
|
|
175
184
|
图表会保留源码,并在上方说明失败原因。
|
|
176
|
-
- **Office 预览是内容,不是排版**:`.docx`
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
185
|
+
- **Office 预览是内容,不是排版**:`.docx` 显示标题、列表、引用、表格、图片,以及文档
|
|
186
|
+
自身携带的格式 —— 每段文字的字体、字号、字重、下划线、删除线、上/下标、颜色与高亮,
|
|
187
|
+
每个段落的对齐、缩进与间距 —— 这些都经**样式级联**解析,所以「格式定义在样式里而不是
|
|
188
|
+
写在 run 上」的文字也会按文档的本意绘制。**没有**的是所有需要排版引擎的东西:分栏与
|
|
189
|
+
分页、页眉页脚、表格边框与底纹、文本框、图表、SmartArt、动画。**主题字体**同样不解析
|
|
190
|
+
—— 引用主题的 run 使用页面自身的默认字体,而不是去猜主题是什么。`.xlsx` 显示单元格的
|
|
191
|
+
值;`.pptx` 显示每页的文字与图片。公式显示文件缓存的值,不做重算。
|
|
181
192
|
- **只读取 OOXML 格式**:`.doc`、`.xls`、`.ppt` 是更早的二进制容器,本窗格不解析
|
|
182
193
|
—— 会说明这一点并提供下载。
|
|
183
194
|
- **预览受「完整读取」上限约束**:官方 Web 组合默认 32 MiB,超过的 PDF 或 Office
|
|
@@ -191,8 +202,8 @@ profile。
|
|
|
191
202
|
## 参与开发
|
|
192
203
|
|
|
193
204
|
构建、检查、产物模型,以及客户端 bundle 如何抵达浏览器:
|
|
194
|
-
[CONTRIBUTING.md](CONTRIBUTING.md)。
|
|
205
|
+
[CONTRIBUTING.md](../CONTRIBUTING.md)。
|
|
195
206
|
|
|
196
207
|
## 许可证
|
|
197
208
|
|
|
198
|
-
MIT —— 见 [LICENSE](LICENSE)。
|
|
209
|
+
MIT —— 见 [LICENSE](../LICENSE)。
|