@doubleelec/dsh-workspace-explorer 0.8.0 → 0.9.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/lib/index.js CHANGED
@@ -22,7 +22,14 @@ const cfg = {
22
22
  max: 400,
23
23
  peekMaxLines: 60
24
24
  };
25
- const WHOLE_MAX_BYTES = 32768;
25
+ /**
26
+ * 预览整读上限:whole=true 且 size ≤ WHOLE_MAX_BYTES 时一次返回全文,更大自动回落分页。
27
+ * 取值说明:100KB 文档约装 5 万字,已覆盖绝大多数文档;512KB 留约 5 倍余量,
28
+ * 本地回环传输毫秒级、渲染无卡顿。「插入内容」复用 whole 分支,但客户端另限
29
+ * 32KB(防刷屏聊天框),与此上限互不干扰。老客户端只发 offset/limit,走分页
30
+ * 路径,不受影响——协议兼容,无需版本号。
31
+ */
32
+ const WHOLE_MAX_BYTES = 524288;
26
33
  const SMALL_FILE_MAX = 4194304;
27
34
  const PAGE_SCAN_CHUNK = 262144;
28
35
  const TREE_MAX_DEPTH = 10;
@@ -86,6 +93,8 @@ async function listDir(abs, baseRel) {
86
93
  /**
87
94
  * 按行读取 [offset, offset+limit) 一页内容。
88
95
  * 小文件(≤4MB)整读、行数精确;大文件块扫描定位行区间,行数未知(null)。
96
+ * 注意:预览/编辑整读走 `whole` 分支(上限 WHOLE_MAX_BYTES),此处 SMALL_FILE_MAX
97
+ * 只决定分页查询走"整读内存分支"还是"块扫描分支",与 whole 上限是两个独立阈值。
89
98
  */
90
99
  /** @internal 按行读取一页内容。 */
91
100
  async function readLinesPage(abs, offset, limit) {
@@ -5,8 +5,20 @@
5
5
  export declare const fmtSize: (n: number | null | undefined) => string;
6
6
  /** 浏览器安全的 basename(兼容正斜杠结尾;DSH 内不依赖 node:path)。 */
7
7
  export declare const basename: (p: string) => string;
8
+ /** 路径归一化(比较用):反斜杠转正斜杠、去尾斜杠、小写——Windows 下会话 cwd 与工作区 path 常在三处不一致。 */
9
+ export declare const normPath: (p: string) => string;
8
10
  /** 取小写扩展名;点开头(隐藏文件)或无扩展名返回空串。 */
9
11
  export declare const extOf: (name: string) => string;
12
+ /** 展示层噪声目录名单(与 host 名单一致,前端展示过滤用,host 不动)。 */
13
+ export declare const NOISE_DIRS: string[];
14
+ /** 展示层噪声判断(纯前端,host 不动):名单命中的目录必藏;hideNoise 开时外加所有 `.` 开头目录。点开头文件永远保留。 */
15
+ export declare function isNoiseDir(name: string, hideNoise: boolean): boolean;
16
+ export interface VisibleEntry {
17
+ name: string;
18
+ type: 'directory' | 'file';
19
+ }
20
+ /** 展示层过滤:文件树渲染前调用;host 返回全量,@ 搜索走原数据不受影响。 */
21
+ export declare function visibleEntries<T extends VisibleEntry>(entries: T[], hideNoise: boolean): T[];
10
22
  /** 把 /dsh-we/api/tree 的平铺条目渲染成带缩进与树形连线的文本块(目录拖拽 / 多选批量插入共用)。 */
11
23
  export declare function formatTreeBlock(name: string, entries: Array<{
12
24
  rel: string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Mermaid 图表懒加载(浏览器端)。
3
+ *
4
+ * 约束:client bundle 走 purity 门禁(非平台 @deepseek-ai/* 一律内联),
5
+ * mermaid 体积 ~1MB+ 不能打进 lib/client.js(当前仅 119KB)。
6
+ * 因此运行时从 CDN 懒加载,点「渲染图表」时才拉取;无网/CSP 拦截时
7
+ * 回落显示源码,不阻塞 Markdown 预览主流程。
8
+ */
9
+ export declare const MERMAID_CDN_URLS: string[];
10
+ /** 是否 mermaid 代码块(大小写/首尾空格不敏感)。 */
11
+ export declare function isMermaidLang(lang: string): boolean;
12
+ interface MermaidApi {
13
+ initialize(cfg: Record<string, unknown>): void;
14
+ render(id: string, text: string): Promise<{
15
+ svg: string;
16
+ }>;
17
+ }
18
+ /** 懒加载 mermaid(首选 jsdelivr,失败回落 unpkg),并完成一次性 initialize。 */
19
+ export declare function loadMermaid(): Promise<MermaidApi>;
20
+ /** 测试/调试用:清空单例(生产代码勿调)。 */
21
+ export declare function __resetMermaidCacheForTest(): void;
22
+ export {};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 预览恢复状态(模块级内存,Panel 卸载后仍保留)。
3
+ *
4
+ * 只记 Tab + 预览文件(root/rel/name/size) + MD 渲染/源码视图;
5
+ * mermaid 渲染态不记——MermaidBlock 每次挂载都从 idle 开始,
6
+ * 重开预览即回到「渲染图表」按钮,不自动拉 CDN。
7
+ */
8
+ export type PreviewTab = 'files' | 'preview' | 'settings';
9
+ export type MdView = 'rendered' | 'source';
10
+ export interface SavedPreviewRef {
11
+ root: string;
12
+ rel: string;
13
+ name: string;
14
+ size: number | null;
15
+ }
16
+ export declare function getSavedTab(): PreviewTab;
17
+ export declare function savePreviewTab(t: PreviewTab): void;
18
+ export declare function getSavedPreview(): SavedPreviewRef | null;
19
+ export declare function savePreviewRef(root: string, rel: string, name: string, size: number | null): void;
20
+ export declare function clearSavedPreview(): void;
21
+ export declare function getSavedMdView(): MdView;
22
+ export declare function saveMdView(v: MdView): void;
23
+ /** 同 root 才恢复预览(工作区切换后旧 rel 不再有效)。 */
24
+ export declare function shouldRestorePreview(saved: SavedPreviewRef | null, root: string | null): saved is SavedPreviewRef;
25
+ /** 测试用:清空记忆(生产代码勿调)。 */
26
+ export declare function __resetPreviewStateForTest(): void;
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "elec-workspace-explorer",
3
3
  "name": "工作区文件面板 (Workspace Explorer)",
4
- "version": "0.8.0",
4
+ "version": "0.9.1",
5
5
  "description": "右侧弹出面板展示当前工作区目录文件树,顶部 Tab 切换文件/设置,点击或拖拽文件引用到聊天输入框发送给大模型",
6
6
  "kind": "dynamic-cordis-plugin",
7
7
  "platforms": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubleelec/dsh-workspace-explorer",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "description": "DeepSeek Harness 工作区文件资源管理器(原生插件):右侧面板展示工作区目录树,点击/拖拽插入文件引用,含搜索/预览/国际化 | Native DSH plugin: workspace file-tree panel with click/drag references, search, preview, i18n.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,11 +38,11 @@
38
38
  "lib",
39
39
  "dsh.plugin.json",
40
40
  "cordis.patch.yml",
41
- "docs",
41
+ "scripts",
42
42
  "demo",
43
43
  "assets",
44
44
  "README.md",
45
- "README.zh.md",
45
+ "DEV.md",
46
46
  "LICENSE",
47
47
  "manifest.json"
48
48
  ],
@@ -0,0 +1,89 @@
1
+ #Requires -Version 5.1
2
+ <#
3
+ .SYNOPSIS
4
+ Install this repo into the prod web profile (3080) in one elevation.
5
+
6
+ .DESCRIPTION
7
+ Run in an elevated PowerShell (right-click -> Run as administrator).
8
+ Everything needing elevation happens inside this one session:
9
+ 1. npm run build (lib/ is what DSH actually loads).
10
+ 2. Install the local repo into the web profile as a decoupled copy.
11
+ The dev profile (3090) is intentionally NOT touched: it is a symlink to
12
+ this repo, so `npm run build` + refresh 3090 is all dev needs — no
13
+ install step, no elevation. See DEV.md for the dev loop.
14
+
15
+ .EXAMPLE
16
+ powershell -ExecutionPolicy Bypass -File scripts/setup.ps1
17
+ .EXAMPLE
18
+ powershell -ExecutionPolicy Bypass -File scripts/setup.ps1 -SkipBuild
19
+ #>
20
+ [CmdletBinding()]
21
+ param(
22
+ [switch]$SkipBuild
23
+ )
24
+
25
+ $ErrorActionPreference = 'Stop'
26
+ $Repo = Split-Path -Parent $PSScriptRoot
27
+
28
+ # 0) Preflight: repo sanity
29
+ $pkgJson = Join-Path $Repo 'package.json'
30
+ if (-not (Test-Path $pkgJson)) { throw "package.json not found in $Repo — run this script from the repo's scripts/ folder." }
31
+
32
+ Write-Host "`n== build (lib/ is what DSH loads) ==" -ForegroundColor Cyan
33
+ if ($SkipBuild) { Write-Host 'skipped (--SkipBuild).' }
34
+ else {
35
+ Push-Location $Repo
36
+ try { npm run build } finally { Pop-Location }
37
+ }
38
+
39
+ Write-Host "`n== web profile (3080): local file: install (decoupled copy) ==" -ForegroundColor Cyan
40
+ # `dsh plugin add` reuses the existing file: copy when the dep already exists
41
+ # (output shows `reused 1, added 0`), silently keeping the STALE bundle —
42
+ # that was the 2026-09-16 miss: 3090 toggled, 3080 didn't. So move the old
43
+ # copy to a backup first, then add + install (forces `added 1`), then verify
44
+ # the new bundle. ANY failure below restores the backup, so 3080 keeps
45
+ # running the previous version instead of ending up with no plugin at all.
46
+ $webCopy = Join-Path $env:USERPROFILE '.dsh\profiles\web\node_modules\@doubleelec\dsh-workspace-explorer'
47
+ $backup = "$webCopy.bak"
48
+ if (Test-Path $backup) { Remove-Item -Recurse -Force $backup }
49
+ if (Test-Path $webCopy) {
50
+ Write-Host "backing up current copy: $webCopy -> $backup"
51
+ Move-Item -Force $webCopy $backup
52
+ }
53
+ $installFailed = $true
54
+ try {
55
+ Push-Location $Repo
56
+ try {
57
+ # forward slashes: file: deps must not use backslashes
58
+ $uri = 'file://' + ($Repo -replace '\\', '/')
59
+ dsh plugin --profile web add -w $uri
60
+ if ($LASTEXITCODE -ne 0) { throw "dsh plugin add failed (exit $LASTEXITCODE)." }
61
+ dsh plugin --profile web install
62
+ if ($LASTEXITCODE -ne 0) { throw "dsh plugin install failed (exit $LASTEXITCODE)." }
63
+ } finally { Pop-Location }
64
+ $webBundle = Join-Path $webCopy 'lib\client.js'
65
+ if (-not (Test-Path $webBundle)) { throw "install failed: $webBundle missing after install." }
66
+ $probe = Select-String -Path $webBundle -Pattern 'dshwe-toggle' -SimpleMatch | Select-Object -First 1
67
+ if (-not $probe) {
68
+ throw 'install verification failed: new bundle marker (dshwe-toggle) not found in web copy — refusing to declare success.'
69
+ }
70
+ Write-Host "verified: new bundle present in web copy ($($probe.LineNumber))." -ForegroundColor Green
71
+ $installFailed = $false
72
+ } finally {
73
+ if ($installFailed) {
74
+ Write-Warning 'install failed — restoring previous version.'
75
+ if (Test-Path $webCopy) { Remove-Item -Recurse -Force $webCopy }
76
+ if (Test-Path $backup) { Move-Item -Force $backup $webCopy; Write-Host "restored: $webCopy (previous version back in place)." -ForegroundColor Yellow }
77
+ throw 'aborted: web profile left untouched (previous version restored).'
78
+ }
79
+ if (Test-Path $backup) { Remove-Item -Recurse -Force $backup }
80
+ }
81
+
82
+ Write-Host @'
83
+
84
+ Done. Verify:
85
+ client-only change (src/client/*): refresh http://127.0.0.1:3080
86
+ host change (src/index.ts, e.g. noise filter): RESTART `dsh web`
87
+ (the old host stays in memory across page refreshes — refresh alone
88
+ will keep showing stale behavior like a still-visible .github)
89
+ '@ -ForegroundColor Green
package/README.zh.md DELETED
@@ -1,175 +0,0 @@
1
- # dsh-workspace-explorer
2
-
3
- > 自维护 fork([doubleelec](https://github.com/doubleelec))—— 基于
4
- > [Jiyr0119/dsh-workspace-explorer](https://github.com/Jiyr0119/dsh-workspace-explorer) v0.7.1(MIT)。
5
- > npm 包:`@doubleelec/dsh-workspace-explorer`。
6
-
7
- [English](README.md) | **中文**
8
-
9
- [![License](https://img.shields.io/github/license/doubleelec/dsh-workspace-explorer)](LICENSE)
10
- [![GitHub stars](https://img.shields.io/github/stars/doubleelec/dsh-workspace-explorer)](https://github.com/doubleelec/dsh-workspace-explorer/stargazers)
11
- [![Last commit](https://img.shields.io/github/last-commit/doubleelec/dsh-workspace-explorer)](https://github.com/doubleelec/dsh-workspace-explorer)
12
-
13
- <p align="center">
14
- ⭐ 顺手留颗 Star,维护者能高兴一整天 &nbsp;·&nbsp; <a href="https://github.com/doubleelec/dsh-workspace-explorer">行,给你一颗 Star</a>
15
- </p>
16
-
17
- > 给 DeepSeek Harness Web UI 的工作区文件资源管理器:会话头部一个**「工作区文件」胶囊按钮**(功能名称 + 文件夹图标,与 Session log 按钮同排)打开动画弹窗,展示当前工作区目录树;点击文件即预览,一键分享进对话,也可拖进输入框。
18
-
19
- 灵感来自 VS Code / Cursor 的项目目录树,弥补 DSH 添加工作台后没有目录视图的空白。
20
-
21
- ## 为什么用它
22
-
23
- - **先预览,绝不误触** — 点击文件行只在独立「预览」Tab 打开,不会往草稿里乱塞文本。分享是显式动作:行首的 ⏎ 箭头按钮指向左下输入框,图标自己就说了文件要去哪。
24
- - **Markdown 就该是排版的样子** — `.md` / `.mdx` 默认渲染(标题/列表/代码块/引用/表格/任务列表),一键切回源码。零依赖手写渲染器,React 元素构建,天生防 XSS,不用消毒库。
25
- - **花式引用,一步到位** — 单击分享、拖拽到光标处、Shift / ⌘ 多选批量插入,或在输入框打 `@` 模糊搜全树文件(5000 条 / 10 层),面板不开也能用。
26
- - **不用离开就能改** — 预览面板一键进编辑态(保存/放弃/取消),保存时检测外部修改,直接写盘。
27
- - **该大就大** — 头部一键全屏覆盖整个会话区,看大文件/长 MD,再点(或 `Esc`)回来。
28
- - **绝不挡路** — 弹窗在会话头部与输入框之间实时测量,永不盖住输入框;左下角拖拽调大小并记忆(双击恢复);噪声目录自动隐藏,大小显示、相对/绝对引用格式都可实时调。
29
-
30
- ## 🖥 演示 Demo
31
-
32
- ![dsh-workspace-explorer 演示](demo/preview.gif)
33
-
34
- *演示 GIF(录制于 v0.5.1):「工作区文件」胶囊入口、多选批量插入、目录拖拽 → 紧凑目录树文本、分页预览与设置页。新版预览 Tab、文件编辑与 Markdown 渲染见下方截图。*
35
-
36
- <details>
37
- <summary><b>截图</b> Screenshots</summary>
38
-
39
- ![面板](assets/screenshots/panel.png)
40
-
41
- ![目录树](assets/screenshots/tree.png)
42
-
43
- ![分屏预览](assets/screenshots/preview.png)
44
-
45
- ![编辑模式](assets/screenshots/edit.png)
46
-
47
- ![插入并发送](assets/screenshots/insert.png)
48
-
49
- </details>
50
-
51
- ## 功能特性
52
-
53
- - 📂 **动画弹窗** — 会话头部右侧(与 session log 同排)的**「工作区文件」胶囊按钮**(功能名称 + 文件夹图标,与 DSH 原生 **Session log** 下载按钮同款样式)点击后,弹出一个带淡入/缩放动画的浮动面板;弹窗位置实时测量,**位于会话头部与输入框之间**(聊天区右侧),绝不会盖住输入框。**左下角拖拽调大小**(宽+高,localStorage 记忆,双击恢复)
54
- - 🗂 **顶部 Tab 栏** — 文件 / 预览 / 设置;设置页实时调节行为(隐藏噪声目录、显示大小、引用格式),并同步进 DSH 设置 → 工作区文件
55
- - 🗂 **懒加载展开** — 目录按需加载,自动隐藏 `node_modules` / `.git` / `dist` / `__pycache__` 等噪声目录
56
- - 🎨 **文件类型图标** — 按扩展名着色的实心文档徽标(TS / JS / Python / JSON / Markdown / 图片 / 配置 / 脚本等),目录为琥珀色文件夹、展开态高亮;正在预览的文件带蓝色圆点
57
- - 🖱 **点击预览** — 点击文件行(或 `Enter` / `空格`)在「预览」Tab 打开;行首 **⏎ 按钮**把 `@路径` 引用插入输入框(`@` / `i` 快捷键亦可)
58
- - ⛶ **全屏模式** — 头部关闭键旁的按钮一键全屏(看大文件/长 MD),再点恢复;`Esc` 先退全屏再关闭
59
- - 🖱 **拖拽插入** — 文件拖到输入框内任意位置在光标处插入(带全屏虚线提示),拖到其他位置则追加到末尾;**目录也可拖拽**,松开即插入限层数的紧凑目录树文本
60
- - 🖱 **多选批量插入** — Shift / ⌘ 点击多选,一键批量插入(文件 → 引用,目录 → 目录树)
61
- - ⌨️ **随处 `@` 引用** — 输入框打 `@` 模糊搜工作区文件(文件名或路径,50 条候选,500 个路径高亮),面板不开也能用(会话 cwd 自动发现)
62
- - 🌓 **跟随主题** — 全部使用 DSH 的 `--dsw-alias-*` 设计 token,浅色/深色自动适配;原生弹窗外观(16px 圆角、lv3 阴影)
63
- - 🔍 **搜索过滤** — 按文件名过滤整棵树(5000 条 / 10 层,显示匹配数)
64
- - 📝 **Markdown 渲染** — `.md` / `.mdx` 默认渲染排版(标题、加粗/斜体/删除线、代码块带语言标签、引用、有序/无序/任务列表、表格、分隔线);一键切回源码;超大分页文件自动回落源码
65
- - ✏️ **预览 Tab** — 整文件视图(≤4MB 一次读完,更大走分页并显示总行数与当前页);可插入引用,小文件(≤32KB)可直接插入完整内容
66
- - 📝 **文件编辑** — 预览面板点击「编辑」进入 textarea 编辑态,支持保存/放弃/取消;保存时检测文件外部修改
67
- - 🌐 **国际化** — 通过 DSH locale 服务注册中/英词典,面板跟随 DSH 界面语言切换
68
-
69
- ## 快速开始
70
-
71
- ### 安装与使用
72
-
73
- 一条命令装好完整插件,无需构建、无需改任何配置。npm 包同时提供原生 Host 半区(`lib/index.js`,webServer JSON 路由 `/dsh-we/api/list|peek|tree|config|write`)和浏览器 bundle(`lib/client.js` 经 `dsh.plugin.json`)。
74
-
75
- ```bash
76
- dsh plugin --profile web add -w @doubleelec/dsh-workspace-explorer@latest
77
- ```
78
-
79
- (或在 DSH 市场点击安装按钮)。安装后会话头部即出现**「工作区文件」胶囊(名称 + 图标)**;必要时重启或硬刷新 Web UI。这是零配置、免构建的路径。
80
-
81
- > ℹ️ **pnpm 提示**:现代 pnpm(9/10)会拒绝在 workspace root 直接 add(`ERR_PNPM_ADDING_TO_ROOT`),故命令带 `-w`。另一种做法:在 `~/.dsh/profiles/web/.npmrc` 写入 `ignore-workspace-root-check=true`。
82
-
83
- > ⚠️ **常见误解**:收录本身不会自动安装任何东西 —— 用户仍需点安装。安装后即出现完整 UI(原生 bundle,无启动报错)。
84
-
85
- 详细步骤见 [`docs/install.md`](./docs/install.md)。
86
-
87
- ### 使用
88
-
89
- 1. 点击会话头部右上角的**「工作区文件」胶囊按钮**(功能名称 + 文件夹图标,与 Session log 按钮同排)打开弹窗
90
- 2. 展开目录浏览文件,**点击文件即预览**
91
- 3. 点行首 **⏎ 按钮**(或把文件拖进输入框,或打 `@` + 文件名)引用它,然后发送
92
- 4. 用弹窗顶部的「设置」Tab(或 DSH 设置 → 工作区文件)调整面板行为
93
-
94
- ## 目录结构
95
-
96
- ```
97
- dsh-workspace-explorer/
98
- ├── README.md # 文档 — English(默认)
99
- ├── README.zh.md # 文档 — 中文
100
- ├── LICENSE # MIT
101
- ├── CHANGELOG.md # 变更记录
102
- ├── manifest.json # 插件元信息
103
- ├── package.json # npm 包(@doubleelec/dsh-workspace-explorer)
104
- ├── demo/
105
- │ ├── index.html # 交互式模拟预览(GitHub Pages)
106
- │ └── preview.gif # 演示动图(README)
107
- ├── .github/
108
- │ └── workflows/
109
- │ └── pages.yml # 部署 demo/ 到 GitHub Pages(手动;预览已隐藏)
110
- ├── docs/
111
- │ ├── install.md # 安装指南
112
- │ ├── local-debugging.md# 本地开发(symlink + dev profile)
113
- │ └── publish.md # 发布流程(GitHub + npm)
114
- ├── src/
115
- │ ├── index.ts # 原生 Host 半区:webServer JSON 路由(/dsh-we/api/*)
116
- │ └── client/
117
- │ ├── index.tsx # 原生 Client 半区:弹窗 + 文件树 + 预览 + 拖拽
118
- │ ├── markdown.ts # 零依赖 Markdown 解析/渲染(防 XSS)
119
- │ ├── format.ts # 纯格式化工具
120
- │ └── popupLayout.ts# 弹窗几何计算(单测覆盖)
121
- ├── test/ # vitest 套件(format / host / popupLayout / markdown)
122
- └── lib/ # 构建产物(lib/index.js + lib/client.js)
123
- ```
124
-
125
- ## 实现要点
126
-
127
- | 能力 | 机制 |
128
- |---|---|
129
- | 目录读取 | Host `fs` 经 `resolveRel` 限定的 root+rel(`/dsh-we/api/list`),目录优先,400 条上限 |
130
- | 文件预览 | ≤4MB 整读,更大走行偏移缓存分页(`/dsh-we/api/peek`);二进制嗅探,≤32KB 可内联 |
131
- | 目录树/搜索索引 | 限深/限预算递归(`/dsh-we/api/tree`,10 层 / 5000 条) |
132
- | 文件写入 | `/dsh-we/api/write`,按大小检测外部修改 |
133
- | Host→Client 通信 | 同源 `fetch POST /dsh-we/api/*`(路径约束,无任意路径读取) |
134
- | 弹窗 | `shell.overlay` 槽位(`useWorkspaces` / `useSessions`),会话头部与输入框之间实时测量;左下角拖拽调大小并记忆 |
135
- | 开关按钮 | `conversation.session.header.utilities` 槽位(「工作区文件」胶囊:名称 + 图标) |
136
- | 写入输入框 | `conversation.input.dock` → `inputActions.setDraft`,另有 `conversation.input` 服务兜底 |
137
- | `@` 提及 | `inputTriggers.registerSource`(模糊候选 + lexicon 高亮),根目录从 sessions cwd 自动发现 |
138
- | 拖拽插入 | HTML5 DnD;输入框内走原生光标插入,其他位置追加 |
139
- | Markdown | 手写解析器 → React 元素(无 `innerHTML`);源码切换;分页回落 |
140
- | 主题/国际化 | `--dsw-alias-*` CSS 变量(浅/深色);中/英经 DSH locale 服务 |
141
-
142
- ## 版本
143
-
144
- 当前版本 **v0.8.0** — **预览优先交互**(点行预览、↙ 分享)、**Markdown 渲染**、**会话区全屏**、**单包清理**(删除动态粘贴版)。
145
- 变更记录见 [CHANGELOG.md](./CHANGELOG.md)。
146
-
147
- ## Roadmap
148
-
149
- 聚焦两条与产品真正相关的主线:**读路径**(把模型指向代码)与**写路径**(编辑文件)。其余事项全部挪到 Backlog 搁置,不再与产品功能平级。
150
-
151
- **已完成 ✅**
152
-
153
- - [x] v0.1 核心:右侧文件树、点击/拖拽插入引用、DSH 原生观感
154
- - [x] 全树搜索过滤;小文件(≤32KB)内容插入
155
- - [x] 国际化(zh/en,跟随 DSH 界面语言)
156
- - [x] `@` 提及源(sessions cwd 自动发现 + lexicon 高亮);统一 `@路径` 引用格式
157
- - [x] 演示页中英切换、GitHub Pages 预览、演示 GIF、市场截图素材
158
- - [x] npm 包 + `dsh.bundle` 契约 + awesome 列表
159
- - [x] 多目标引用:目录拖拽(紧凑目录树)+ 多选批量插入
160
- - [x] 整文件预览(≤4MB),大文件分页回落
161
- - [x] 预览优先交互:点行预览、⏎ 分享、`@` / `i` 快捷键
162
- - [x] Markdown 渲染(零依赖、防 XSS) + 源码切换
163
- - [x] 面板内文件编辑 + 外部修改检测
164
- - [x] 弹窗可调大小并记忆;预览独立 Tab
165
-
166
- **搁置 Backlog**(出现真实需求再做)
167
-
168
- - 跨已加载目录的内容搜索(host 侧 grep);最近文件 / 收藏夹
169
- - 完整键盘导航;复制路径 / 在系统文件管理器中显示
170
- - 虚拟滚动(超大目录);浅/深色主题回归检查;Playwright e2e
171
- - CI(lint + e2e + 自动发布)
172
-
173
- ## License
174
-
175
- [MIT](./LICENSE)
@@ -1,23 +0,0 @@
1
- # awesome-dsh-plugin 提交草稿 / Submission draft (not part of this repo's runtime)
2
- #
3
- # 达标后(≥10 commits + 维护者答复 dsh.bundle 问题),把下面内容粘贴到 awesome 仓库:
4
- # data/plugins/Jiyr0119__dsh-workspace-explorer.yml
5
- # 并把 screenshots 列表合并进 awesome 仓库的 data/screenshots.json(以仓库 URL 为 key)。
6
- #
7
- # Paste into the awesome repo when eligible:
8
- # data/plugins/Jiyr0119__dsh-workspace-explorer.yml
9
- # and merge the screenshots list into data/screenshots.json keyed by the repo URL.
10
-
11
- url: https://github.com/Jiyr0119/dsh-workspace-explorer
12
- name: Jiyr0119/dsh-workspace-explorer
13
- category: ui
14
- description:
15
- en: Workspace file-tree panel for the DSH web UI, with click or drag-to-composer file references.
16
- zh: 为 DSH Web UI 提供工作区文件树面板,点击或拖拽文件引用到输入框。
17
-
18
- # data/screenshots.json 条目(1-8 张,GitHub 托管)/ entry for data/screenshots.json
19
- # "https://github.com/Jiyr0119/dsh-workspace-explorer": [
20
- # "https://raw.githubusercontent.com/Jiyr0119/dsh-workspace-explorer/main/assets/screenshots/panel.png",
21
- # "https://raw.githubusercontent.com/Jiyr0119/dsh-workspace-explorer/main/assets/screenshots/tree.png",
22
- # "https://raw.githubusercontent.com/Jiyr0119/dsh-workspace-explorer/main/assets/screenshots/insert.png"
23
- # ]