@jidekaixin2dian/dsh-file-actions 0.1.14 → 0.1.16
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 +111 -71
- package/README.en.md +76 -128
- package/README.md +78 -131
- package/SECURITY.md +44 -30
- package/lib/client.js +2852 -2328
- package/locale/en.json +6 -6
- package/locale/zh.json +6 -6
- package/package.json +74 -73
package/CHANGELOG.md
CHANGED
|
@@ -1,71 +1,111 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 0.1.
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.16 — 2026-10-26
|
|
4
|
+
|
|
5
|
+
- 重整中英文 README:安装更新优先,保留兼容与权限边界,开发说明移入独立文档。
|
|
6
|
+
- Refresh Chinese/English documentation and installation guidance; runtime behavior is unchanged.
|
|
7
|
+
- 明确市场与 npm 更新入口,指定公开截图,收起首页维护流程。
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## 0.1.15 — 2026-10-25
|
|
11
|
+
|
|
12
|
+
- 审查修复:工作区外复制在确认不可用或异常时拒绝读取;无效 UTF-8 不再静默替换后报告成功;分块下载核对版本、路径、偏移和大小,读取期间变化会中止。
|
|
13
|
+
- HTML/SVG 默认静态预览,关闭脚本与外部资源;可信内容可显式启用脚本与联网,同时保留 opaque-origin sandbox。
|
|
14
|
+
- 修复 Blob 缩略图缓存按 URL 长度计费的问题,改按实际字节控制 16 MiB 预算;修复应用筛选后的悬停/键盘索引,补齐相对行号引用、点文件、Dockerfile 和 UNC 链接识别。
|
|
15
|
+
- 持久化关联缓存先展示、后台校验;失效关联不再继续启动,打开失败清缓存但不重放动作。
|
|
16
|
+
- 声明最低宿主 `engines.dsh >=0.2.1-rc.2`;默认宿主 pin 更新到 rc.3,保留 rc.2 验证;CI 两系统均测这两个版本。浏览器 fixture 使用安全端口范围,避免随机命中 Chromium 禁用端口。
|
|
17
|
+
- npm 发布要求从同一版本 tag 调度,tag 已合入 main 且四项 Validation 检查成功;调度 ref/SHA 与源码一致,校验并直接发布同一份 GitHub Release 归档。
|
|
18
|
+
|
|
19
|
+
- 行内代码视为显式引用:聊天里蓝色文件名冷右键(不先悬停)就能打开菜单;`pre` 代码块内仍按猜测处理。
|
|
20
|
+
- 关联应用查询失败时不再渲染「应用查询失败,点击重试」死行,也不再留永远灰着的编辑器占位。宿主枚举应用时只要碰到一个坏掉的系统关联就会整批抛错(典型是卸载残留的 ProgID,如没有 `shell\open\command` 的 `XIUXIU`),此时菜单只保留能用的动作,下一次右键自动重试;查询进行中仍保留占位行,避免下方行跳动。
|
|
21
|
+
- 关联应用查询提速:悬停即预取、按扩展名做 in-flight 去重、成功结果缓存 10 分钟(空结果 15 秒)、超时 8 秒改为 6 秒。
|
|
22
|
+
- 菜单跟随滚动按行位移精确平移,不再因重新计算落点触发边缘夹紧而漂移。
|
|
23
|
+
- 类型与图标补齐到 20 类(code / data / subtitle / font / design / model / disk / exec / video / audio 等),24 格图标按类着色。
|
|
24
|
+
- 视频读首帧做预览缩略图(取片长 10%,封顶 3 秒,限 8 MB)。
|
|
25
|
+
- 「首选应用」的星标从 `★/☆` 文字字形换成同套 24 格矢量图标:未选空心、选中实心蓝,字重与行内其它图标一致(文字字形会跟着页面字体变粗变细)。
|
|
26
|
+
- 「打开方式」子菜单首次打开时顶部圆角被粘性表头盖成直角(滚动后顶部遮罩淡出表头才显得圆);菜单改为把子元素裁剪进圆角盒,首开即圆角。
|
|
27
|
+
- 浮窗跟随与尺寸:滚动时菜单按行位移滑行,子菜单不再被关掉而是跟着自己那一行走(偏移用 `offsetLeft/offsetTop` 捕获,入场动画期间也不会漂 2–6px,滚动跟走用 rAF 合并);定位距指针 2px,两边按余量取较宽的一侧并把高度封顶到该侧余量(菜单 `min(余量, 74vh, 520px)`,子菜单 `min(余量, 56vh, 400px)`)——装不下时在面板内部滚动,不再夹紧回来盖住指针所在行;宽度改为内容自适应并收在 15–26em(子菜单 17–23em);缩略图 `clamp(76px,15vh,118px)`;入场改为 110ms 缩放淡入。
|
|
28
|
+
- 预览不再和文件名行叠在一起:缩略图改成独立的圆角块(`overflow:hidden` + 绝对定位 `object-fit:contain`)。视频首帧 188px 曾溢出 137px 的容器、压在文件名与大小上;`max-height:100%` 在网格里没约束住它。图片与视频走同一套。
|
|
29
|
+
- 视觉对齐统一到一条左轴线(菜单边缘内 13px):预览块、类型图标、行图标、分隔线、页脚分隔线、子菜单表头与搜索框左右缘全部对齐;头部分隔线不再比其它分隔线长。
|
|
30
|
+
- 预览可点击看大图:点缩略图弹出遮罩层(Esc / 点图关闭),先于菜单响应 Esc,菜单不关;视频标注为「首帧」并指引用「在浏览器中播放」看完整视频。
|
|
31
|
+
- 键盘:Tab / Shift+Tab 在菜单内逐行移动(焦点不再跑出菜单);大图打开时由遮罩层独占 Esc/Enter/空格。
|
|
32
|
+
- 关联应用结果持久化到 localStorage(24 小时、上限 512 KB、按最近使用优先,图标过大自动降级为纯列表):实测首次枚举 **1820 ms** → 同页再次 **13 ms** → 刷新后 **15 ms**;读入时校验条目,避免脏数据渲染成空行。
|
|
33
|
+
- 「另存为…」与「在浏览器中打开」改为分块读取:宿主单次读有 2 MB 上限,超过就报「读取失败」——4.9 MB 的 `成片.mp4` 因此只能失败。实测修复后完整下载 5,087,432 字节;总读取上限 64 MB,超出提示「文件过大」。
|
|
34
|
+
- 预览带来源路径守卫:迟到的解码结果只会画到它所属的文件上,切换文件不会再看到上一个文件的图。
|
|
35
|
+
- 体积与开销:删除无引用的图标与文案、把「主菜单/子菜单」两套定位逻辑合并为 `fitPanel()`(同时统一了边距与封顶规则);缩略图缓存从「最多 12 个」改为**按字节封顶 16 MB**(原先最坏可驻留约 96 MB 的对象 URL)。静置开销实测:500 次指针事件 10 ms → 9 ms(约 18 µs/次),滚动跟随偏移不变。
|
|
36
|
+
- 字典去重:ZH/EN 的 `kinds` 删除重复的 `video` / `audio`,新增「字典不允许重复键」静态测试。
|
|
37
|
+
|
|
38
|
+
## 0.1.14 — 2026-10-24
|
|
39
|
+
|
|
40
|
+
- 图标整套重画(24 格、统一描边)。
|
|
41
|
+
- Shift+右键从「让位」改为「页面先处理,无人处理则回退」,不再出现按了没反应。
|
|
42
|
+
|
|
43
|
+
## 0.1.13 — 2026-10-24
|
|
44
|
+
|
|
45
|
+
- 渠道对齐:0.1.12 的 GitHub Release 资产早于安全修复(tag 停在 `6aa0b38`),而 npm 0.1.12 已包含修复;自 0.1.13 起两个渠道从同一提交构建。代码与 0.1.12(npm)一致,仅升版本号。
|
|
46
|
+
- 发布链:npm 改用 Trusted Publishing(OIDC,无 token、无 OTP),`npm publish --provenance` 附带 SLSA 来源证明。
|
|
47
|
+
|
|
48
|
+
## 0.1.12 — 2026-10-24
|
|
49
|
+
|
|
50
|
+
- 「复制文件内容」作用于会话工作区之外的文件时先弹确认框,说明该文件不属于本对话;拒绝则不读取任何字节。工作区内的复制行为不变。缓解聊天文本被注入绝对路径后的诱导复制。
|
|
51
|
+
- 移除菜单调试用的 `window.__dfaDebug` 全局对象;错误路径保留 `console.warn`。
|
|
52
|
+
- 新增 `npm-publish.yml`:手动触发的 npm 发布 workflow,先跑测试再 `npm publish --provenance`(OIDC 来源证明),action 按 SHA 固定。
|
|
53
|
+
|
|
54
|
+
## 0.1.11 — 2026-10-24
|
|
55
|
+
|
|
56
|
+
- 新增 npm 分发渠道,包名保留 `@jidekaixin2dian/dsh-file-actions`,GitHub Release 安装方式继续可用。
|
|
57
|
+
- 明确公开发布到官方 npm registry;中英文文档补充 DSH 安装、固定版本与仅下载命令。
|
|
58
|
+
- 插件功能与 0.1.10 相同,无新增运行时依赖或构建步骤。
|
|
59
|
+
|
|
60
|
+
## 0.1.10 — 2026-10-23
|
|
61
|
+
|
|
62
|
+
- 移除其他产品对标表述;中文显示名改为「文件与链接操作」,保留包名与英文名 File Actions。
|
|
63
|
+
- 明确文件引用显示探测状态与可重试错误;猜测路径先验证再接管右键,Shift+右键保留原生菜单。
|
|
64
|
+
- 按文件类型保存首选应用;关联列表优先排列首选、系统默认和编辑器,保留全部应用。
|
|
65
|
+
- 区分应用查询中、空结果和失败重试,预留菜单行,异步缩略图不再重绘操作区域。
|
|
66
|
+
- 字号跟随页面根字号,窄视口约束菜单宽度;修复搜索无结果时键盘仍可能执行隐藏应用的问题。
|
|
67
|
+
|
|
68
|
+
## 0.1.9
|
|
69
|
+
|
|
70
|
+
- 插件面板显示中文名与中文简介(`locale/zh.json`、`locale/en.json` 的 `meta.title` / `meta.description`),卡片和详情不再回落到英文 package.json 描述。
|
|
71
|
+
|
|
72
|
+
## 0.1.8
|
|
73
|
+
|
|
74
|
+
- 菜单与提示条加一层按主题计算的可读性底:液态玻璃/壁纸主题下文字不再被背景冲淡,玻璃感保留。
|
|
75
|
+
|
|
76
|
+
## 0.1.7
|
|
77
|
+
|
|
78
|
+
- 蓝色引用统一:GitHub 等网页链接也走同一个菜单,给「打开链接 / 复制链接 / 复制链接文字」。
|
|
79
|
+
- 修掉与 Toolgate 同时安装时的启动报错:两个浏览器 bundle 都在顶层声明 `const factory`,DSH 合并加载时冲突;现在各自隔离作用域,并补了重复加载的回归测试。
|
|
80
|
+
- 一并包含 0.1.6 的未发布修复:HTML/SVG 预览改用独立来源的 sandbox 帧、资源地址优先于子元素提示、切换点击时取消过期菜单、缩略图缓存按会话/路径/版本、可复现的真实宿主与浏览器检查。
|
|
81
|
+
|
|
82
|
+
## 0.1.6
|
|
83
|
+
|
|
84
|
+
- HTML/SVG 预览与 DSH 页面隔离(sandbox 帧,保留脚本执行),清空 popup opener。
|
|
85
|
+
- 保留 POSIX 根与资源地址的 Session 身份;资源地址优先于子元素 title;POSIX 路径区分大小写。
|
|
86
|
+
- 取消过期菜单、卸载时回收缩略图 URL、缩略图按会话/路径/版本缓存并拒绝不完整数据。
|
|
87
|
+
- 增加可复现的真实宿主/浏览器 CI 与归档安装检查;可选全 Web 工具改用官方 CLI 与自有进程校验。
|
|
88
|
+
|
|
89
|
+
## 0.1.5
|
|
90
|
+
|
|
91
|
+
资源链接、带装饰的文件名、字幕与媒体分类。
|
|
92
|
+
|
|
93
|
+
## 0.1.4
|
|
94
|
+
|
|
95
|
+
`dsh-resource://` 链接、字幕、视频与音频类型。
|
|
96
|
+
|
|
97
|
+
## 0.1.3
|
|
98
|
+
|
|
99
|
+
「打开方式」搜索、滚动渐隐、图片缩略图、市场预览图。
|
|
100
|
+
|
|
101
|
+
## 0.1.2
|
|
102
|
+
|
|
103
|
+
菜单视觉重做:文件身份头部、键盘提示、子菜单表头。
|
|
104
|
+
|
|
105
|
+
## 0.1.1
|
|
106
|
+
|
|
107
|
+
自审修复:复制上限、焦点与滚动、无扩展名文件。
|
|
108
|
+
|
|
109
|
+
## 0.1.0
|
|
110
|
+
|
|
111
|
+
首个版本。
|
package/README.en.md
CHANGED
|
@@ -1,128 +1,76 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Right-click
|
|
8
|
-
|
|
9
|
-

|
|
82
|
-
|
|
83
|
-

|
|
84
|
-
|
|
85
|
-
## Limitations
|
|
86
|
-
|
|
87
|
-
- Not a native menu. Text follows the page root font size and page zoom, not the operating system text-size setting directly.
|
|
88
|
-
- *Open with* only lists registered applications. Preferences do not change OS defaults.
|
|
89
|
-
- Opening an editor currently opens the file only; the pinned Host API does not accept line or column positions.
|
|
90
|
-
- Save as uses the browser's download dialog with the original file name.
|
|
91
|
-
- Copy contents is capped at 2 MiB. Save as and browser previews use the host complete-file cap (32 MiB by default on DSH 0.2.1-rc.2); larger files must be opened externally.
|
|
92
|
-
- HTML/SVG previews retain scripts in an opaque-origin sandbox. They cannot access the DSH page or cookies. Relative sibling assets and actions that require top navigation or same-origin storage may not work.
|
|
93
|
-
- Web UI only — the terminal build has nothing to right-click.
|
|
94
|
-
|
|
95
|
-
## FAQ
|
|
96
|
-
|
|
97
|
-
**Why does the native menu appear?** Plain prose and editable fields keep it. Guessed file paths are verified on hover or focus; cold or failed guesses retain the native menu. Explicit file references show a reason and a retry action on failure.
|
|
98
|
-
|
|
99
|
-
**Is *Open with* unavailable?** Loading, empty results and failed queries are shown separately. Click a failed query to retry.
|
|
100
|
-
|
|
101
|
-
**Nothing opens in the browser?** The popup may have been blocked; allow popups and retry.
|
|
102
|
-
|
|
103
|
-
**How do I choose an application?** Click ☆ in *Open with*. Without a preference, the shortcut uses a recognised editor. *Open file* continues to use the system default.
|
|
104
|
-
|
|
105
|
-
## Development and verification
|
|
106
|
-
|
|
107
|
-
Node >=24, Git and pnpm:
|
|
108
|
-
|
|
109
|
-
```sh
|
|
110
|
-
npm ci --ignore-scripts
|
|
111
|
-
npm test
|
|
112
|
-
npm run setup:host
|
|
113
|
-
npm run test:host
|
|
114
|
-
npm run pack:check
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
The pinned host is DSH **0.2.1-rc.2** (`687f282e8625c6b8d11ff58211a90524be2e4317`). `DFA_HOST` can reuse a clean checkout at that exact commit. Windows uses headless Edge; Linux needs `npx --no-install playwright install --with-deps chromium`. CI runs both systems. No runtime dependencies or build step are added to the plugin.
|
|
118
|
-
|
|
119
|
-
The browser suite uses the actual client bundle and real WorkspaceFiles over synthetic references. It checks Session identity, sandboxed script isolation, a real 3 MiB download and unload behavior. A separate browser suite uses deterministic Remote responses for native-menu fallback, preferences, asynchronous stability, search and large text. This is not a complete Desktop or OS application-launch test. Optional full-Web drivers and historical assertion counts are documented in [test-e2e](test-e2e/README.md).
|
|
120
|
-
|
|
121
|
-
## Releases
|
|
122
|
-
|
|
123
|
-
- [Latest release](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest)
|
|
124
|
-
- [Announcement](https://github.com/deepseek-ai/deepseek-harness/discussions/10576)
|
|
125
|
-
|
|
126
|
-
## License
|
|
127
|
-
|
|
128
|
-
MIT
|
|
1
|
+
# File Actions
|
|
2
|
+
|
|
3
|
+
**Turn a file reference in your conversation into the next action.**
|
|
4
|
+
|
|
5
|
+
[中文](README.md) · [Marketplace](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-file-actions/) · [Download](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest) · [Changelog](CHANGELOG.md)
|
|
6
|
+
|
|
7
|
+
Right-click a file or link to open it, choose an application, reveal it, copy it or save it. Works with chat references, delivery cards, tool results and sidebars that expose file paths.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
| Your next step | Available actions |
|
|
12
|
+
|---|---|
|
|
13
|
+
| Keep editing | Open with the default app, search applications, save a preference per file type |
|
|
14
|
+
| Locate and reference | Reveal in the file manager; copy paths, names or references with line numbers |
|
|
15
|
+
| View and export | Preview supported documents and media, copy text, save a local file |
|
|
16
|
+
| Share a link | Open, copy the URL or text, copy as Markdown |
|
|
17
|
+
|
|
18
|
+
## Install and update
|
|
19
|
+
|
|
20
|
+
Requires **DSH >=0.2.1-rc.2 and Node >=24**. CI verifies DSH rc.2 / rc.3.
|
|
21
|
+
|
|
22
|
+
Search for **dsh-file-actions** in the marketplace and verify author **jidekaixin2dian**. Existing users can check updates under installed plugins. Catalog and registry mirrors may take time to refresh.
|
|
23
|
+
|
|
24
|
+
Alternatively, quit DSH completely and use the same command for installation or updates:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
dsh plugin --profile desktop add @jidekaixin2dian/dsh-file-actions --registry=https://registry.npmjs.org
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Reopen DSH. Downloadable archives are available in [Releases](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest). A plain `npm install` does not register the plugin with DSH.
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary>Alternative installation and removal</summary>
|
|
34
|
+
|
|
35
|
+
```powershell
|
|
36
|
+
dsh plugin --profile desktop add https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest/download/dsh-file-actions.tgz
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Remove, then reopen DSH:
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
dsh plugin --profile desktop remove @jidekaixin2dian/dsh-file-actions
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
</details>
|
|
46
|
+
|
|
47
|
+
## Use
|
|
48
|
+
|
|
49
|
+
1. Right-click a file reference, delivery card or file tree. Explicit references open directly; guessed text paths are verified first.
|
|
50
|
+
2. Search **Open with** and star an application to remember it for that file type. OS defaults stay unchanged.
|
|
51
|
+
3. Enlarge image thumbnails or view supported documents, audio and video in the browser.
|
|
52
|
+
|
|
53
|
+
Keyboard: `Shift+F10` opens the menu, `↑ ↓` move, `→` enters a submenu, `Enter` runs and `Esc` closes. `Shift+right-click` gives the page's own handler priority.
|
|
54
|
+
|
|
55
|
+
## Boundaries
|
|
56
|
+
|
|
57
|
+
- File operations use official DSH APIs and path authorization. Application lists depend on system associations; the plugin does not repair registry entries.
|
|
58
|
+
- Copy contents accepts **valid UTF-8 up to 2 MiB**. Copies outside the workspace require explicit confirmation; unavailable confirmation cancels the read.
|
|
59
|
+
- Save and browser previews read up to **64 MiB** and stop on inconsistent chunks. This is not an atomic filesystem snapshot.
|
|
60
|
+
- HTML / SVG previews block scripts and external resources by default. Enable scripts and networking only for a trusted file; the preview remains isolated from DSH. Relative assets may not work. Clicking a document link is an explicit navigation.
|
|
61
|
+
- Editor actions do not jump to line/column positions. Save uses browser download behavior. The plugin needs the graphical / Web UI.
|
|
62
|
+
|
|
63
|
+
<details>
|
|
64
|
+
<summary>FAQ</summary>
|
|
65
|
+
|
|
66
|
+
**Why the native menu?** Plain text, editable fields and unverified guessed paths retain it. Failed explicit references show a reason and retry action.
|
|
67
|
+
|
|
68
|
+
**Where is Open with?** Empty or failed queries hide those rows; right-click again to retry. Broken associations need a system or host fix.
|
|
69
|
+
|
|
70
|
+
**No preview window?** Check whether the browser blocked a popup.
|
|
71
|
+
|
|
72
|
+
</details>
|
|
73
|
+
|
|
74
|
+
[Development and verification](https://github.com/jidekaixin2dian/dsh-file-actions/blob/main/docs/development.md) · [Security](SECURITY.md) · [Issues](https://github.com/jidekaixin2dian/dsh-file-actions/issues)
|
|
75
|
+
|
|
76
|
+
MIT · Independent community plugin, not affiliated with DeepSeek.
|
package/README.md
CHANGED
|
@@ -1,131 +1,78 @@
|
|
|
1
|
-
# File Actions · 文件与链接操作
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-

|
|
85
|
-
|
|
86
|
-

|
|
87
|
-
|
|
88
|
-
## 限制
|
|
89
|
-
|
|
90
|
-
- 不是系统原生菜单;字号跟随页面根字号和页面缩放,不直接读取操作系统的文字大小设置。
|
|
91
|
-
- 「打开方式」只列系统已注册的关联应用;首选设置不修改系统默认关联。
|
|
92
|
-
- 打开编辑器目前只定位到文件;固定版本宿主的打开接口不支持传入行号和列号。
|
|
93
|
-
- 另存为走浏览器的下载对话框,文件名固定为原文件名。
|
|
94
|
-
- 复制文件内容上限 2 MiB。另存为和浏览器预览受宿主整文件读取上限约束,DSH 0.2.1-rc.2 默认 32 MiB;更大的文件请使用外部应用。
|
|
95
|
-
- HTML/SVG 预览在独立来源的 sandbox iframe 内运行脚本,不能读取 DSH 页面或 Cookie;相邻文件的相对资源、顶层跳转和同源存储可能不可用。
|
|
96
|
-
- 只支持网页版界面,终端里的 DSH 没有可右键的元素。
|
|
97
|
-
|
|
98
|
-
## 常见问题
|
|
99
|
-
|
|
100
|
-
**右键出现原生菜单?** 普通文字与输入框保留原生菜单。猜测的文件路径需要先在悬停或聚焦时验证;未验证或验证失败时也保留原生菜单。明确文件引用失败时,菜单内会显示原因与重试入口。
|
|
101
|
-
|
|
102
|
-
**「打开方式」不可用?** 菜单会分别显示正在查询、没有关联应用和查询失败;查询失败可以点击重试。
|
|
103
|
-
|
|
104
|
-
**「在浏览器中打开」没反应?** 浏览器可能拦了新窗口,允许弹窗后重试。
|
|
105
|
-
|
|
106
|
-
**怎么指定首选应用?** 在「打开方式」中点击应用旁的 ☆。未指定首选时,快捷打开行采用系统关联里能识别的编辑器;「打开文件」仍按系统默认方式打开。
|
|
107
|
-
|
|
108
|
-
## 开发与验证
|
|
109
|
-
|
|
110
|
-
需要 Node >=24、Git、pnpm:
|
|
111
|
-
|
|
112
|
-
```sh
|
|
113
|
-
npm ci --ignore-scripts
|
|
114
|
-
npm test
|
|
115
|
-
npm run setup:host
|
|
116
|
-
npm run test:host
|
|
117
|
-
npm run pack:check
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
固定宿主为 DSH **0.2.1-rc.2**(`687f282e8625c6b8d11ff58211a90524be2e4317`)。`DFA_HOST` 可复用相同 commit 的干净 checkout。Windows 使用 headless Edge;Linux 先运行 `npx --no-install playwright install --with-deps chromium`。CI 同时覆盖两种系统。插件仍无运行时依赖、无构建步骤。
|
|
121
|
-
|
|
122
|
-
浏览器套件把实际 client bundle 与真实 WorkspaceFiles 接到合成文件引用上,检查会话身份、预览脚本隔离、真实 3 MiB 下载及卸载行为;另用确定性 Remote 响应检查右键回退、首选应用、异步菜单稳定性、搜索和大字号。这不是完整 Desktop 或外部应用启动验收。可选完整 Web 驱动和历史断言计数见 [test-e2e](test-e2e/README.md)。
|
|
123
|
-
|
|
124
|
-
## 版本
|
|
125
|
-
|
|
126
|
-
- [最新版本](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest)
|
|
127
|
-
- [讨论帖](https://github.com/deepseek-ai/deepseek-harness/discussions/10576)
|
|
128
|
-
|
|
129
|
-
## 许可
|
|
130
|
-
|
|
131
|
-
MIT
|
|
1
|
+
# File Actions · 文件与链接操作
|
|
2
|
+
|
|
3
|
+
**从聊天里的文件引用,直接到你要做的操作。**
|
|
4
|
+
|
|
5
|
+
[English](README.en.md) · [插件市场](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-file-actions/) · [下载](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest) · [更新记录](CHANGELOG.md)
|
|
6
|
+
|
|
7
|
+
右键文件名或链接,即可打开、选择应用、定位、复制与另存。支持聊天引用、交付卡片、工具结果,以及提供文件路径的侧栏。
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
| 想做什么 | 可以怎么做 |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 接着编辑文件 | 用默认应用打开,或搜索「打开方式」并收藏首选应用 |
|
|
14
|
+
| 找到文件与引用 | 在文件管理器定位,复制绝对 / 相对路径、文件名或带行号引用 |
|
|
15
|
+
| 查看与带走内容 | 预览支持的文档、图片或媒体;复制文本;另存为本地文件 |
|
|
16
|
+
| 分享链接 | 打开网页,复制链接、链接文字或 Markdown |
|
|
17
|
+
|
|
18
|
+
## 安装与更新
|
|
19
|
+
|
|
20
|
+
需要 **DSH >=0.2.1-rc.2、Node >=24**;持续验证 DSH rc.2 / rc.3。
|
|
21
|
+
|
|
22
|
+
在插件市场搜索 **dsh-file-actions**,确认作者为 **jidekaixin2dian** 后安装;已有用户在「已安装」中检查更新。市场数据与 npm 镜像可能有同步延迟。
|
|
23
|
+
|
|
24
|
+
也可完全退出 DSH 后,使用同一条 CLI 命令安装或更新:
|
|
25
|
+
|
|
26
|
+
```powershell
|
|
27
|
+
dsh plugin --profile desktop add @jidekaixin2dian/dsh-file-actions --registry=https://registry.npmjs.org
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
重新打开 DSH 生效。离线包可从 [Release](https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest) 下载;普通 `npm install` 不会把插件注册进 DSH。
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary>其他安装方式与卸载</summary>
|
|
34
|
+
|
|
35
|
+
GitHub Release 安装:
|
|
36
|
+
|
|
37
|
+
```powershell
|
|
38
|
+
dsh plugin --profile desktop add https://github.com/jidekaixin2dian/dsh-file-actions/releases/latest/download/dsh-file-actions.tgz
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
卸载后重新打开 DSH:
|
|
42
|
+
|
|
43
|
+
```powershell
|
|
44
|
+
dsh plugin --profile desktop remove @jidekaixin2dian/dsh-file-actions
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
## 用起来
|
|
50
|
+
|
|
51
|
+
1. 在聊天文件名、文件卡片或文件树上右键。明确引用可直接操作,普通文字里的疑似路径会先验证。
|
|
52
|
+
2. 选择「打开方式」可搜索应用,点击星标保存当前文件类型的首选;不会改变系统默认应用。
|
|
53
|
+
3. 图片支持缩略图与放大预览;支持的文档、音视频可在浏览器中查看。
|
|
54
|
+
|
|
55
|
+
键盘:`Shift+F10` 打开菜单,`↑ ↓` 移动,`→` 进入子菜单,`Enter` 执行,`Esc` 关闭。`Shift+右键` 优先交给页面原有菜单。
|
|
56
|
+
|
|
57
|
+
## 使用边界
|
|
58
|
+
|
|
59
|
+
- 打开与定位沿用 DSH 官方接口和路径授权;应用列表取决于系统关联。失效关联可能导致列表不可用,插件不会修改注册表。
|
|
60
|
+
- 复制内容仅支持 **有效 UTF-8、最大 2 MiB**。工作区外复制需要明确确认;确认不可用时取消读取。
|
|
61
|
+
- 另存为和浏览器预览最多读取 **64 MiB**,分块内容不一致时中止;不是文件系统原子快照。
|
|
62
|
+
- HTML / SVG 默认静态预览并阻止脚本和外部资源。仅在信任文件后启用脚本与联网;预览仍与 DSH 页面隔离。相对资源可能不可用,点击文件内链接属于主动导航。
|
|
63
|
+
- 编辑器打开暂不跳到行列位置;另存为使用浏览器下载行为。插件用于 DSH 图形 / Web 界面,终端界面不适用。
|
|
64
|
+
|
|
65
|
+
<details>
|
|
66
|
+
<summary>常见问题</summary>
|
|
67
|
+
|
|
68
|
+
**为什么还是原生右键菜单?** 普通文字、输入框,以及尚未验证的疑似路径保留原生菜单。明确引用验证失败时会显示原因与重试入口。
|
|
69
|
+
|
|
70
|
+
**找不到「打开方式」?** 查询为空或失败时会隐藏关联行,下次右键重试。系统损坏的应用关联需要在系统或宿主侧处理。
|
|
71
|
+
|
|
72
|
+
**预览没有打开?** 检查浏览器是否拦截了弹窗。
|
|
73
|
+
|
|
74
|
+
</details>
|
|
75
|
+
|
|
76
|
+
[开发与验证](https://github.com/jidekaixin2dian/dsh-file-actions/blob/main/docs/development.md) · [安全说明](SECURITY.md) · [反馈问题](https://github.com/jidekaixin2dian/dsh-file-actions/issues)
|
|
77
|
+
|
|
78
|
+
MIT · 独立社区插件,与 DeepSeek 官方无隶属关系。
|