dsh-ide-window 0.2.1 → 0.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/AGENTS.md CHANGED
@@ -13,7 +13,8 @@
13
13
 
14
14
  - 仓库:`https://github.com/simons-jiang/dsh-ide-window`(分支 `main`)
15
15
  - 包名:`@local/dsh-ide-window`(以 `link:` 方式装进 DSH 的 profile)
16
- - 目标 DSH 版本:`0.2.2-rc.3`(桌面应用 + Web profile 都要能跑)
16
+ - 目标 DSH 版本:`0.2.2-rc.3` 及以上(桌面应用 + Web profile 都要能跑)
17
+ - LSP 管道包版本**跟随当前 DSH**(脚本从 Info.plist / exe 版本读,不写死;DSH 升级后重跑脚本)
17
18
  - 语言栈:宿主 `index.js`(Node ESM)+ 客户端 `src/client/*.js`(无构建链,手写 `h()`)
18
19
 
19
20
  ---
@@ -56,7 +57,7 @@ locale/{zh,en}.json UI 文案(165 个键);插件管理器也从这里
56
57
  | `06-platform.js` | **客户端平台层**:`toPosix/toNative`、`isAbsolutePath`、手势选项与按键文案(`apply()` 里按 `ctx.shortcuts.platform` 换实例) |
57
58
  | `07-log.js` | **客户端日志**:100 条环形缓冲 `ideLogRecord/ideLogSnapshot`,供「复制诊断信息」上报 |
58
59
  | `10-core.js` | store(`useSyncExternalStore` 订阅)、偏好持久化、标签页/历史/视图状态 |
59
- | `12-theme.js` | **配色主题**:注册表(10 套)、`<link id="iw-theme-link">` 切换、状态栏切换器;主题同时提供 8 个语法色变量 |
60
+ | `12-theme.js` | **配色主题**:注册表(10 套)、`<link id="iw-theme-link">` 切换、状态栏切换器;主题同时提供 8 个语法色变量;对外发布主题(见 3.6) |
60
61
  | `20-tree.js` | 文件树(展开、筛选、拖宽、`⌘P` 定位) |
61
62
  | `30-code.js` | 代码视图(行渲染、符号点击、跳转、右键菜单挂载) |
62
63
  | `40-panel.js` | 面板骨架(工具栏、横幅、布局、字号 CSS 变量) |
@@ -119,6 +120,18 @@ locale/{zh,en}.json UI 文案(165 个键);插件管理器也从这里
119
120
  | `/dsh-ide/theme` | 主题样式表 | `GET ?id=<主题>` 返回 `themes/<id>.css`(唯一非 JSON 路由,浏览器用 `<link>` 取);id 只允许 `[a-z0-9-]`,未知 404、非法 400 |
120
121
  | `/dsh-ide/license` | JetBrains 授权 | `{action:'status'}` 跑 `intellij-server license status`;`{action:'open'}` 后台跑 `license login --browser` 并回传授权 URL(6 秒内没出现 URL 就回传工具输出)。给这两个 JVM 动词加 `-Didea.log.path=<tmp>`,避免受限环境下写 `~/Library/Logs` 失败 |
121
122
 
123
+ ### 3.3.1 跨插件主题约定(和 dsh-git-window)
124
+
125
+ 代码工作区选的配色要能带着同页的 `dsh-git-window` 一起变,靠三条约定,**只有本插件写、对方只读**:
126
+
127
+ | 通道 | 形状 | 用途 |
128
+ |---|---|---|
129
+ | `localStorage['dsh-theme']` | 主题 id 字符串,空/缺失 = 跟随 DSH | 后加载的插件启动时能立刻读到 |
130
+ | `window` 事件 `dsh-theme` | `{ detail: { id } }` | 同页立即生效,不用刷新 |
131
+ | `data-dsh-theme` 属性 + `/dsh-ide/theme?id=<id>` | 主题文件选择器就是 `[data-dsh-theme="<id>"]` | 对方给自己的根节点加属性、`link` 同一份样式表即可套用 |
132
+
133
+ 改主题文件的选择器或键名 = 改接口,必须同步改 `dsh-git-window`(它的 `src/client/05-theme.js` 只读这三样)。对方没装本插件时样式请求 404,它保持自己的 token 外观,不会报错。
134
+
122
135
  ### 3.4 用到的 DSH 槽位
123
136
 
124
137
  | 槽 | 用途 |
@@ -308,6 +321,7 @@ dsh plugin --profile desktop add link:~/dev/dsh-ide-window
308
321
  | 「复制诊断信息」点了没反应、页面像卡住 | `await navigator.clipboard.writeText()` 在无权限/嵌入式环境下可能永不 resolve | 剪贴板用 `Promise.race` 加 1.5 秒超时,上报日志优先,超时退化为「已写入宿主日志」提示 |
309
322
  | 主题弹层里点某一项没反应(真鼠标点不动,代码里 `.click()` 却正常) | 关闭弹层用的是 `document` 上的 **capture** `pointerdown`:真实鼠标先派发 pointerdown,监听器先把弹层卸载,行的 click 永远到不了 | 关闭监听要放过落在弹层/触发按钮内部的按压(`target.closest('.iw-theme-pop, .iw-theme-button')`);**交互必须用真实指针事件验证**,程序化 `.click()` 会绕过 pointerdown |
310
323
  | 切到浅色主题后代码看不清(深色语法色仍在用) | 语法高亮是写死的深色配色,没有跟着主题走 | 语法色走 `--iw-syn-*` 变量,每套主题各给一组并按对比度校验(正文类 ≥4.5:1,注释 ≥3.5:1);`test/theme.mjs` 断言每套主题都有这 8 个变量 |
324
+ | 两个插件(代码工作区 + git 窗口)配色不一致 | 各自注入 CSS、各自用 DSH token,主题是本插件私有的 | 把主题做成跨插件约定:`localStorage['dsh-theme']` + `dsh-theme` 事件 + `[data-dsh-theme]` 选择器;对方只读这三样。只在 `.iw-root` 上作用域的选择器无法共享,必须用通用属性 |
311
325
 
312
326
  ---
313
327
 
package/CHANGELOG.md CHANGED
@@ -6,6 +6,26 @@
6
6
  升级方式:DSH →「插件」→ 打开插件的「版本」区 →「检查更新」,或直接卸载后重新安装。
7
7
  (`link:` 本地安装不参与版本检查,拉取仓库即可。)
8
8
 
9
+ ## [0.3.1] — 2026-11-19
10
+
11
+ ### 修复
12
+
13
+ - **LSP 安装脚本把管道包版本写死了**:脚本固定在 `0.2.2-rc.3`,而 DSH 会自动升级(例如升到 `0.2.2-rc.5`),于是 `pnpm add` 装回旧版本的包,导航随之失效。
14
+ 现在 `install.sh` / `install.ps1` / `enable-navigation.sh` / `enable-navigation.ps1` / `restore-profile.sh` / `restore-profile.ps1` 都改为**读取当前安装的 DSH 版本**(macOS 从 `Info.plist`、Windows 从 exe 的 `ProductVersion`),再安装同版本的 `@deepseek-ai/dsh-lsp` 与 `dsh-lsp-stdio`。
15
+ - 版本读不到时用 `latest`;检测到的版本在注册表里还不存在(DSH 夜间版比包发布快)时,先按检测版本安装,失败才回退 `latest` 并提示,不会因为网络抖动就悄悄换版本。
16
+ - 可用 `--lsp-version <版本>`(macOS)或 `-LspVersion <版本>`(Windows)显式指定,或用环境变量 `DSH_LSP_VERSION` 覆盖。
17
+
18
+ ## [0.3.0] — 2026-11-19
19
+
20
+ ### 新增
21
+
22
+ - **主题跨插件共享**:同一页面里的 `dsh-git-window` 会跟随代码工作区的配色,切「德古拉」或「IntelliJ 浅色」时它的工具窗口同步换色,无需单独设置。
23
+ - 共享方式是三条约定,本插件只写不读:`localStorage['dsh-theme']`(当前主题 id)、`window` 事件 `dsh-theme`(同页立即生效)、`[data-dsh-theme]` 属性(配合 `/dsh-ide/theme?id=<id>` 样式表)。其他插件给自己的根节点加这个属性即可套用同一套配色。
24
+
25
+ ### 变更
26
+
27
+ - 主题样式表的选择器从 `.iw-root[data-iw-theme="<id>"]` 改为通用的 `[data-dsh-theme="<id>"]`。**自己改过主题文件选择器的用户**需要同步这一行;正常使用不受影响。
28
+
9
29
  ## [0.2.1] — 2026-11-19
10
30
 
11
31
  ### 文档
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  DeepSeek Harness(DSH)的 **IDEA 风格代码工作区**插件:把中央区域切成「文件树 + 编辑标签页 + 实时源码」,进入时自动收起左侧导航栏,对话随时可切回。
4
4
 
5
5
  - 目标 DSH:**0.2.2-rc.3 及以上(0.2.x)**(桌面版或 Web 版都可以,`engines.dsh` 会拦住 0.3 及更旧版本)
6
+ - LSP 管道包版本**跟随当前 DSH**(脚本自动读取,不写死),DSH 夜间版升级后重跑一次脚本即可
6
7
  - 仓库:<https://github.com/simons-jiang/dsh-ide-window>
7
8
  - 包名:`dsh-ide-window`(已发布到 npm)
8
9
 
@@ -223,9 +224,15 @@ dsh plugin --profile desktop add "git+https://github.com/simons-jiang/dsh-ide-wi
223
224
 
224
225
  语法高亮有单独一层变量(`--iw-syn-keyword` / `string` / `number` / `comment` / `annotation` / `type` / `function` / `punct`),同样由主题文件提供——深色主题的关键字色放到白底上根本看不清,所以每套主题都自带一组经过对比度检查的语法色(浅色主题的关键字/字符串/类型都 ≥4.5:1)。
225
226
 
227
+ 主题还是一个**跨插件约定**:同一页面里 `dsh-git-window` 的工具窗口会跟着变色(它只读这里的主题,不写):
228
+
229
+ - `localStorage['dsh-theme']` 存当前主题 id(空 = 跟随 DSH)
230
+ - `window` 上派发 `dsh-theme` 事件(`detail.id`)——同页立即生效
231
+ - 样式表匹配 `[data-dsh-theme="<id>"]`,任何插件给自己的根节点加上这个属性就套用同一套配色,并自行 `link` 到 `/dsh-ide/theme?id=<id>`
232
+
226
233
  因此:
227
234
 
228
- - 组件样式**一行都不用改**,切换主题只是把 `<link id="iw-theme-link">` 指到另一个文件(外加一个 `data-iw-theme` 属性)
235
+ - 组件样式**一行都不用改**,切换主题只是把 `<link id="iw-theme-link">` 指到另一个文件(外加一个 `data-dsh-theme` 属性)
229
236
  - 改调色板**不需要重新构建** `client.js`,刷新页面即可看到
230
237
  - 新增一套主题 = 放一个 `themes/<id>.css` + 在 `src/client/12-theme.js` 的注册表加一行(`themes/index.json`、`test/theme.mjs` 会校验三处一致:10 套、5 深 5 浅、变量集合完全相同)
231
238
 
@@ -278,7 +285,14 @@ DSH 的 LSP 是可选能力,插件只消费它。没装时进入代码工作
278
285
 
279
286
  ### 手动三步(脚本做的事)
280
287
 
281
- 1. 管道包:`cd ~/.dsh/profiles/desktop && pnpm add @deepseek-ai/dsh-lsp@0.2.2-rc.5 @deepseek-ai/dsh-lsp-stdio@0.2.2-rc.5`
288
+ 1. 管道包(版本要跟当前 DSH 一致,脚本会自动读取;手动装时这样取):
289
+
290
+ ```sh
291
+ DSH_LSP_VERSION="$(defaults read "/Applications/DeepSeek Harness.app/Contents/Info.plist" CFBundleShortVersionString)"
292
+ cd ~/.dsh/profiles/desktop
293
+ pnpm add "@deepseek-ai/dsh-lsp@$DSH_LSP_VERSION" "@deepseek-ai/dsh-lsp-stdio@$DSH_LSP_VERSION"
294
+ ```
295
+
282
296
  2. 服务器:[intellij-server 271.2085.0 (aarch64)](https://download.jetbrains.com/language-server/intellij-server/271.2085.0/intellij-server-271.2085.0-aarch64.sit) 下载后 `unzip` 到 `~/.dsh/lsp-bin/`
283
297
  3. 授权与重启:`~/.dsh/lsp-bin/*/bin/intellij-server license login`,然后完全退出并重开 DSH
284
298
 
@@ -290,7 +304,7 @@ DSH 的 LSP 是可选能力,插件只消费它。没装时进入代码工作
290
304
  **1) 管道包**(版本必须与 DSH 一致)
291
305
 
292
306
  ```sh
293
- dsh plugin --profile desktop add @deepseek-ai/dsh-lsp@0.2.2-rc.5 @deepseek-ai/dsh-lsp-stdio@0.2.2-rc.5
307
+ dsh plugin --profile desktop add "@deepseek-ai/dsh-lsp@$DSH_LSP_VERSION" "@deepseek-ai/dsh-lsp-stdio@$DSH_LSP_VERSION" # DSH_LSP_VERSION = 当前 DSH 版本,如 0.2.2-rc.5
294
308
  ```
295
309
 
296
310
  **2) 语言服务器**:IntelliJ 授权版(build `271.2085.0`)放到本机 `~/.dsh/lsp-bin/intellij-server-2027.1/`,然后在 profile 的 `cordis.patch.yml` 里插两行:
package/client.js CHANGED
@@ -4296,11 +4296,15 @@ function ideCreateStore(refs) {
4296
4296
  * Colour themes for the code workspace.
4297
4297
  *
4298
4298
  * A palette is a file: `themes/<id>.css` overrides the DSH alias tokens, scoped
4299
- * to `.iw-root[data-iw-theme="<id>"]`. Every `.iw-*` rule already reads those
4300
- * tokens, so a theme never touches a component style — switching a theme points
4299
+ * to `[data-dsh-theme="<id>"]`. Every `.iw-*` rule already reads those tokens, so
4300
+ * a theme never touches a component style — switching a theme points
4301
4301
  * `<link id="iw-theme-link">` at another file and sets one attribute. A palette
4302
4302
  * can be edited without rebuilding the bundle.
4303
4303
  *
4304
+ * The attribute and the storage key are a **shared contract**: a sibling plugin
4305
+ * (`dsh-git-window`) sets the same attribute on its own tool window and loads
4306
+ * the same stylesheet, so both follow one palette. See `idePublishTheme`.
4307
+ *
4304
4308
  * `themes/index.json` lists the same ids; `test/theme.mjs` holds the two in sync
4305
4309
  * and checks that every file defines the same token set.
4306
4310
  */
@@ -4362,10 +4366,45 @@ function ideApplyTheme(id) {
4362
4366
  if (existing.getAttribute('href') !== href) existing.setAttribute('href', href)
4363
4367
  }
4364
4368
 
4369
+ /**
4370
+ * The shared palette contract.
4371
+ *
4372
+ * `dsh-git-window` draws its own tool window; when both plugins are open they
4373
+ * should look like one workspace, so a palette is published, not just applied:
4374
+ *
4375
+ * - `localStorage['dsh-theme']` — the current id (empty means "follow DSH"),
4376
+ * readable by any plugin at start-up;
4377
+ * - `window` event `dsh-theme` with `{ id }` — same document, so a listener
4378
+ * reacts immediately;
4379
+ * - the stylesheet attribute `data-dsh-theme` — whatever element carries it
4380
+ * gets the palette, whichever plugin owns that element.
4381
+ *
4382
+ * Only this plugin writes the key; followers read it.
4383
+ */
4384
+ const IDE_THEME_SHARED_KEY = 'dsh-theme'
4385
+ const IDE_THEME_SHARED_EVENT = 'dsh-theme'
4386
+
4387
+ /** Publish the palette: storage for late loaders, an event for live listeners. */
4388
+ function idePublishTheme(id) {
4389
+ const value = typeof id === 'string' ? id : ''
4390
+ try {
4391
+ if (value === '') globalThis.localStorage?.removeItem(IDE_THEME_SHARED_KEY)
4392
+ else globalThis.localStorage?.setItem(IDE_THEME_SHARED_KEY, value)
4393
+ } catch {
4394
+ /* a browser with storage disabled simply cannot share the palette */
4395
+ }
4396
+ try {
4397
+ globalThis.dispatchEvent?.(new CustomEvent(IDE_THEME_SHARED_EVENT, { detail: { id: value } }))
4398
+ } catch {
4399
+ /* CustomEvent is always available in the panel's browser; ignore if not */
4400
+ }
4401
+ }
4402
+
4365
4403
  /** Apply the saved theme once, and after every change; the panel owns the DOM. */
4366
4404
  function ideUseTheme(themeId) {
4367
4405
  useEffect(() => {
4368
4406
  ideApplyTheme(themeId)
4407
+ idePublishTheme(themeId)
4369
4408
  }, [themeId])
4370
4409
  }
4371
4410
 
@@ -7066,7 +7105,9 @@ function IdePanel({ store, translate, onBackToChat, onToggleSidebar, onEnter, us
7066
7105
  const treeSize = Number.isFinite(state.treeFontSize) ? state.treeFontSize : 14.5
7067
7106
  return h('div', {
7068
7107
  className: 'iw-root',
7069
- 'data-iw-theme': ideIsThemeId(state.theme) ? state.theme : undefined,
7108
+ // The shared palette attribute: the theme stylesheet targets this, so any
7109
+ // plugin that sets it on its own root gets the same colours.
7110
+ 'data-dsh-theme': ideIsThemeId(state.theme) ? state.theme : undefined,
7070
7111
  // The editor and the tree share one typographic scale, set in Settings.
7071
7112
  style: {
7072
7113
  '--iw-code-font-size': `${codeSize}px`,
@@ -11,7 +11,8 @@
11
11
  # powershell -ExecutionPolicy Bypass -File .\enable-navigation.ps1
12
12
  param(
13
13
  [string]$Profile = 'desktop',
14
- [switch]$NoDownload
14
+ [switch]$NoDownload,
15
+ [string]$LspVersion = ''
15
16
  )
16
17
  $ErrorActionPreference = 'Stop'
17
18
 
@@ -30,9 +31,35 @@ trap {
30
31
  exit 1
31
32
  }
32
33
 
33
- $lspVersion = '0.2.2-rc.5'
34
+ # The pipeline packages are published per DSH release: read the version from the
35
+ # installed application instead of pinning it, so a DSH nightly upgrade cannot
36
+ # leave this script installing packages for the old version. `-LspVersion`
37
+ # overrides the detection.
38
+ function Get-DshVersion {
39
+ $candidates = @()
40
+ if ($env:LOCALAPPDATA) { $candidates += (Join-Path $env:LOCALAPPDATA 'Programs\DeepSeek Harness\DeepSeek Harness.exe') }
41
+ if ($env:ProgramFiles) { $candidates += (Join-Path $env:ProgramFiles 'DeepSeek Harness\DeepSeek Harness.exe') }
42
+ if (${env:ProgramFiles(x86)}) { $candidates += (Join-Path ${env:ProgramFiles(x86)} 'DeepSeek Harness\DeepSeek Harness.exe') }
43
+ foreach ($candidate in $candidates) {
44
+ if (-not (Test-Path $candidate)) { continue }
45
+ $version = (Get-Item $candidate).VersionInfo.ProductVersion
46
+ if ($version) { return ($version -replace '^v', '').Trim() }
47
+ }
48
+ return 'latest'
49
+ }
50
+
51
+ $lspVersion = if ($LspVersion) { $LspVersion } else { Get-DshVersion }
52
+
34
53
  $packages = @("@deepseek-ai/dsh-lsp@$lspVersion", "@deepseek-ai/dsh-lsp-stdio@$lspVersion")
35
54
 
55
+ # Only when the detected version cannot be installed at all (not published yet)
56
+ # fall back to `latest`; a network hiccup must not silently change the version.
57
+ function Set-LatestPipeline {
58
+ $script:lspVersion = 'latest'
59
+ $script:packages = @('@deepseek-ai/dsh-lsp@latest', '@deepseek-ai/dsh-lsp-stdio@latest')
60
+ Write-Host " 提示:检测到的版本装不上(可能还没发布),改用 latest。"
61
+ }
62
+
36
63
  # JetBrains publishes the server per platform under the same build. The CDN host
37
64
  # only serves signed URLs, so the download always goes through
38
65
  # download.jetbrains.com.
@@ -96,15 +123,24 @@ function Install-Packages([string[]]$Arguments) {
96
123
  }
97
124
  }
98
125
 
99
- $attempt = Install-Packages (@('add') + @($packages))
100
- if ($attempt.Code -ne 0) {
101
- Write-Host ' 第一次安装失败,pnpm 输出如下:' -ForegroundColor Yellow
102
- Write-Host $attempt.Output
103
- Write-Host ' 改用 npmmirror 镜像重试…' -ForegroundColor Yellow
104
- $attempt = Install-Packages (@('add', '--registry', 'https://registry.npmmirror.com') + @($packages))
126
+ function Install-PipelinePackages {
127
+ $attempt = Install-Packages (@('add') + @($packages))
128
+ if ($attempt.Code -ne 0) {
129
+ Write-Host ' 第一次安装失败,pnpm 输出如下:' -ForegroundColor Yellow
130
+ Write-Host $attempt.Output
131
+ Write-Host ' 改用 npmmirror 镜像重试…' -ForegroundColor Yellow
132
+ $attempt = Install-Packages (@('add', '--registry', 'https://registry.npmmirror.com') + @($packages))
133
+ }
134
+ return $attempt
135
+ }
136
+
137
+ $attempt = Install-PipelinePackages
138
+ if ($attempt.Code -ne 0 -and $lspVersion -ne 'latest') {
139
+ Set-LatestPipeline
140
+ $attempt = Install-PipelinePackages
105
141
  }
106
142
  if ($attempt.Code -ne 0) {
107
- Write-Host ' 镜像也失败,pnpm 输出如下:' -ForegroundColor Red
143
+ Write-Host ' 安装失败,pnpm 输出如下:' -ForegroundColor Red
108
144
  Write-Host $attempt.Output
109
145
  Fail "pnpm add 失败(exit $($attempt.Code)):看上面的 npm 错误码。ERR_PNPM_UNEXPECTED_STORE 表示 pnpm 的 store 版本和 profile 里的不一致;EAI_AGAIN/ETIMEDOUT/ECONNREFUSED 是网络或代理。"
110
146
  }
@@ -5,13 +5,27 @@
5
5
  # ./enable-navigation.sh # packages + server download + patch lines
6
6
  # ./enable-navigation.sh --no-download # skip the server download (already have it)
7
7
  # ./enable-navigation.sh --profile web # another profile
8
+ # ./enable-navigation.sh --lsp-version 0.2.2-rc.5 # pin the pipeline packages
8
9
  #
9
10
  # Safe to re-run. Only writes under ~/.dsh (profile, lsp-bin, lsp-data); the DSH
10
11
  # application itself is never modified.
11
12
  set -euo pipefail
12
13
 
13
- LSP_VERSION="0.2.2-rc.5"
14
+ # The pipeline packages are published per DSH release, so the version is read
15
+ # from the installed application instead of being pinned here: a DSH nightly
16
+ # upgrade would otherwise leave this script installing packages for the old
17
+ # version. `--lsp-version` (or `DSH_LSP_VERSION`) overrides the detection.
18
+ APP_PLIST="/Applications/DeepSeek Harness.app/Contents/Info.plist"
19
+
20
+ dsh_version() {
21
+ [ -f "$APP_PLIST" ] || return 1
22
+ defaults read "$APP_PLIST" CFBundleShortVersionString 2>/dev/null | tr -d '[:space:]'
23
+ }
24
+
25
+ LSP_VERSION="${DSH_LSP_VERSION:-$(dsh_version || true)}"
26
+ [ -n "$LSP_VERSION" ] || LSP_VERSION="latest"
14
27
  PACKAGES=("@deepseek-ai/dsh-lsp@${LSP_VERSION}" "@deepseek-ai/dsh-lsp-stdio@${LSP_VERSION}")
28
+
15
29
  SERVER_URL="https://download.jetbrains.com/language-server/intellij-server/271.2085.0/intellij-server-271.2085.0-aarch64.sit"
16
30
 
17
31
  PROFILE="${DSH_PROFILE:-desktop}"
@@ -25,6 +39,7 @@ while [ $# -gt 0 ]; do
25
39
  case "$1" in
26
40
  --profile) PROFILE="${2:-}"; PROFILE_DIR="$DSH_HOME_DIR/profiles/$PROFILE"; shift 2 ;;
27
41
  --no-download) DOWNLOAD=0; shift ;;
42
+ --lsp-version) LSP_VERSION="${2:-}"; PACKAGES=("@deepseek-ai/dsh-lsp@${LSP_VERSION}" "@deepseek-ai/dsh-lsp-stdio@${LSP_VERSION}"); shift 2 ;;
28
43
  -h|--help) sed -n '2,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
29
44
  *) echo "未知参数:$1" >&2; exit 1 ;;
30
45
  esac
@@ -39,8 +54,28 @@ command -v python3 >/dev/null 2>&1 || fail "需要 python3(macOS 自带)。"
39
54
 
40
55
  # ---- 1. pipeline packages ---------------------------------------------------
41
56
 
42
- step "安装 LSP 管道包(${LSP_VERSION})"
43
- ( cd "$PROFILE_DIR" && pnpm add "${PACKAGES[@]}" >/dev/null && echo " 已安装:@deepseek-ai/dsh-lsp、dsh-lsp-stdio" )
57
+ if [ "$LSP_VERSION" = "latest" ]; then
58
+ step "安装 LSP 管道包(没读到 DSH 版本,用 latest)"
59
+ else
60
+ step "安装 LSP 管道包(跟随当前 DSH:${LSP_VERSION})"
61
+ fi
62
+ install_packages() {
63
+ ( cd "$PROFILE_DIR" && pnpm add "${PACKAGES[@]}" >/dev/null )
64
+ }
65
+
66
+ # A DSH build can be newer than the published packages. Try the detected version
67
+ # first; only when that install fails fall back to `latest`, so a network hiccup
68
+ # does not silently downgrade the pipeline.
69
+ if ! install_packages; then
70
+ if [ "$LSP_VERSION" = "latest" ]; then
71
+ fail "安装 LSP 管道包失败,见上面的 pnpm 输出。"
72
+ fi
73
+ printf '提示:%s 的 LSP 包装不上(可能还没发布),改用 latest 重试。\n' "$LSP_VERSION"
74
+ LSP_VERSION="latest"
75
+ PACKAGES=("@deepseek-ai/dsh-lsp@${LSP_VERSION}" "@deepseek-ai/dsh-lsp-stdio@${LSP_VERSION}")
76
+ install_packages || fail "安装 LSP 管道包失败,见上面的 pnpm 输出。"
77
+ fi
78
+ echo " 已安装:@deepseek-ai/dsh-lsp、dsh-lsp-stdio(${LSP_VERSION})"
44
79
 
45
80
  # ---- 2. language server -----------------------------------------------------
46
81
 
package/install.ps1 CHANGED
@@ -38,7 +38,9 @@ trap {
38
38
 
39
39
  $repoUrl = 'https://github.com/simons-jiang/dsh-ide-window.git'
40
40
  $packageName = 'dsh-ide-window'
41
- $lspPackages = @('@deepseek-ai/dsh-lsp@0.2.2-rc.5', '@deepseek-ai/dsh-lsp-stdio@0.2.2-rc.5')
41
+ # The pipeline packages are published per DSH release; `$lspPackages` is built
42
+ # once the application (and therefore its version) is known. `DSH_LSP_VERSION`
43
+ # overrides the detection.
42
44
 
43
45
  function Step([string]$Text) { Write-Host "`n==> $Text" }
44
46
  function Fail([string]$Text) {
@@ -60,6 +62,18 @@ foreach ($candidate in $candidates) {
60
62
  if (-not $appBin) { Fail '没找到 DeepSeek Harness.exe,请先安装并登录 DSH。' }
61
63
  Write-Host " DSH:$appBin"
62
64
 
65
+ # Read the version from the executable so the pipeline packages always match the
66
+ # running DSH; a hard-coded pin breaks on every automatic upgrade.
67
+ function Get-DshVersion([string]$Exe) {
68
+ $version = (Get-Item $Exe).VersionInfo.ProductVersion
69
+ if (-not $version) { return '' }
70
+ return ($version -replace '^v', '').Trim()
71
+ }
72
+ $lspVersion = if ($env:DSH_LSP_VERSION) { $env:DSH_LSP_VERSION } else { Get-DshVersion $appBin }
73
+ if (-not $lspVersion) { $lspVersion = 'latest' }
74
+ Write-Host " LSP 管道包版本:$lspVersion(跟随 DSH)"
75
+ $lspPackages = @("@deepseek-ai/dsh-lsp@$lspVersion", "@deepseek-ai/dsh-lsp-stdio@$lspVersion")
76
+
63
77
  $dshHome = if ($env:DSH_HOME) { $env:DSH_HOME } else { Join-Path $env:USERPROFILE '.dsh' }
64
78
  $profileDir = Join-Path $dshHome "profiles\$Profile"
65
79
 
@@ -160,8 +174,20 @@ if (-not $installed) {
160
174
  }
161
175
 
162
176
  if ($WithLsp) {
163
- Step '安装 LSP 管道包(语言服务器本身还要另外准备)'
164
- Invoke-Pnpm (@('add') + $lspPackages) $profileDir
177
+ Step "安装 LSP 管道包(跟随当前 DSH:$lspVersion;语言服务器本身还要另外准备)"
178
+ $added = $false
179
+ try {
180
+ Invoke-Pnpm (@('add') + $lspPackages) $profileDir
181
+ $added = $true
182
+ } catch {
183
+ if ($lspVersion -eq 'latest') { throw }
184
+ Write-Host ' 检测到的版本装不上(可能还没发布),改用 latest 重试' -ForegroundColor Yellow
185
+ }
186
+ if (-not $added) {
187
+ $lspVersion = 'latest'
188
+ $lspPackages = @('@deepseek-ai/dsh-lsp@latest', '@deepseek-ai/dsh-lsp-stdio@latest')
189
+ Invoke-Pnpm (@('add') + $lspPackages) $profileDir
190
+ }
165
191
  }
166
192
 
167
193
  # ---- 4. make sure the bundle is listed -------------------------------------
package/install.sh CHANGED
@@ -14,7 +14,16 @@ set -euo pipefail
14
14
 
15
15
  REPO_URL="https://github.com/simons-jiang/dsh-ide-window.git"
16
16
  PACKAGE="dsh-ide-window"
17
- LSP_PACKAGES=("@deepseek-ai/dsh-lsp@0.2.2-rc.5" "@deepseek-ai/dsh-lsp-stdio@0.2.2-rc.5")
17
+ # Pipeline packages follow the installed DSH release (see enable-navigation.sh).
18
+ APP_PLIST="/Applications/DeepSeek Harness.app/Contents/Info.plist"
19
+ lsp_version() {
20
+ [ -f "$APP_PLIST" ] || { printf 'latest'; return; }
21
+ local detected
22
+ detected="$(defaults read "$APP_PLIST" CFBundleShortVersionString 2>/dev/null | tr -d '[:space:]')"
23
+ printf '%s' "${detected:-latest}"
24
+ }
25
+ LSP_VERSION="$(lsp_version)"
26
+ LSP_PACKAGES=("@deepseek-ai/dsh-lsp@${LSP_VERSION}" "@deepseek-ai/dsh-lsp-stdio@${LSP_VERSION}")
18
27
 
19
28
  PROFILE="desktop"
20
29
  DIR="${DSH_IDE_DIR:-$HOME/dev/dsh-ide-window}"
@@ -137,11 +146,25 @@ if ! dsh_cli plugin --profile "$PROFILE" add "link:$DIR"; then
137
146
  fi
138
147
 
139
148
  if [ "$WITH_LSP" = 1 ]; then
140
- step "安装 LSP 管道包(语言服务器本身还要另外准备)"
141
- if ! dsh_cli plugin --profile "$PROFILE" add "${LSP_PACKAGES[@]}"; then
149
+ step "安装 LSP 管道包(跟随当前 DSH:${LSP_VERSION};语言服务器本身还要另外准备)"
150
+ add_pipeline() {
151
+ if dsh_cli plugin --profile "$PROFILE" add "${LSP_PACKAGES[@]}" 2>/dev/null; then
152
+ return 0
153
+ fi
142
154
  echo " 该 profile 由应用托管,改用 profile 内的 pnpm"
143
155
  command -v pnpm >/dev/null 2>&1 || fail "需要 pnpm(DSH 安装插件也依赖它):npm i -g pnpm"
144
156
  ( cd "$PROFILE_DIR" && pnpm add "${LSP_PACKAGES[@]}" )
157
+ }
158
+ # A newer DSH build may not have published pipeline packages yet: fall back to
159
+ # `latest` only when the detected version cannot be installed at all.
160
+ if ! add_pipeline; then
161
+ if [ "$LSP_VERSION" = "latest" ]; then
162
+ fail "安装 LSP 管道包失败,见上面的 pnpm 输出。"
163
+ fi
164
+ echo "提示:${LSP_VERSION} 的 LSP 包装不上(可能还没发布),改用 latest 重试。"
165
+ LSP_VERSION="latest"
166
+ LSP_PACKAGES=("@deepseek-ai/dsh-lsp@${LSP_VERSION}" "@deepseek-ai/dsh-lsp-stdio@${LSP_VERSION}")
167
+ add_pipeline || fail "安装 LSP 管道包失败,见上面的 pnpm 输出。"
145
168
  fi
146
169
  fi
147
170
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ide-window",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "IDEA-style code workspace for DeepSeek Harness: a centre panel with a workspace file tree, editor tabs and live-updating source, while the left navigation column hides.",
5
5
  "type": "module",
6
6
  "icon": "icon.svg",
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="atom-one-light"]` is touched.
6
+ * `[data-dsh-theme="atom-one-light"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="atom-one-light"] {
8
+ [data-dsh-theme="atom-one-light"] {
9
9
  --dsw-alias-bg-base: #fafafa;
10
10
  --dsw-alias-bg-layer-1: #ffffff;
11
11
  --dsw-alias-bg-layer-2: #f0f0f1;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="dracula"]` is touched.
6
+ * `[data-dsh-theme="dracula"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="dracula"] {
8
+ [data-dsh-theme="dracula"] {
9
9
  --dsw-alias-bg-base: #282a36;
10
10
  --dsw-alias-bg-layer-1: #21222c;
11
11
  --dsw-alias-bg-layer-2: #343746;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="github-light"]` is touched.
6
+ * `[data-dsh-theme="github-light"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="github-light"] {
8
+ [data-dsh-theme="github-light"] {
9
9
  --dsw-alias-bg-base: #ffffff;
10
10
  --dsw-alias-bg-layer-1: #f6f8fa;
11
11
  --dsw-alias-bg-layer-2: #f6f8fa;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="intellij-light"]` is touched.
6
+ * `[data-dsh-theme="intellij-light"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="intellij-light"] {
8
+ [data-dsh-theme="intellij-light"] {
9
9
  --dsw-alias-bg-base: #f7f8fa;
10
10
  --dsw-alias-bg-layer-1: #ffffff;
11
11
  --dsw-alias-bg-layer-2: #ebecf0;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="material-light"]` is touched.
6
+ * `[data-dsh-theme="material-light"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="material-light"] {
8
+ [data-dsh-theme="material-light"] {
9
9
  --dsw-alias-bg-base: #fafafa;
10
10
  --dsw-alias-bg-layer-1: #ffffff;
11
11
  --dsw-alias-bg-layer-2: #f2f3f5;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="material-oceanic"]` is touched.
6
+ * `[data-dsh-theme="material-oceanic"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="material-oceanic"] {
8
+ [data-dsh-theme="material-oceanic"] {
9
9
  --dsw-alias-bg-base: #0f111a;
10
10
  --dsw-alias-bg-layer-1: #131521;
11
11
  --dsw-alias-bg-layer-2: #1b1e2b;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="material-palenight"]` is touched.
6
+ * `[data-dsh-theme="material-palenight"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="material-palenight"] {
8
+ [data-dsh-theme="material-palenight"] {
9
9
  --dsw-alias-bg-base: #292d3e;
10
10
  --dsw-alias-bg-layer-1: #2f3445;
11
11
  --dsw-alias-bg-layer-2: #333747;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="monokai-pro"]` is touched.
6
+ * `[data-dsh-theme="monokai-pro"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="monokai-pro"] {
8
+ [data-dsh-theme="monokai-pro"] {
9
9
  --dsw-alias-bg-base: #2d2a2e;
10
10
  --dsw-alias-bg-layer-1: #221f22;
11
11
  --dsw-alias-bg-layer-2: #363337;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="night-owl"]` is touched.
6
+ * `[data-dsh-theme="night-owl"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="night-owl"] {
8
+ [data-dsh-theme="night-owl"] {
9
9
  --dsw-alias-bg-base: #011627;
10
10
  --dsw-alias-bg-layer-1: #0b2942;
11
11
  --dsw-alias-bg-layer-2: #0e2b43;
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Only DSH alias tokens are overridden, scoped to the panel, so every `.iw-*`
5
5
  * rule picks the palette up without knowing this file exists. Nothing outside
6
- * `.iw-root[data-iw-theme="solarized-light"]` is touched.
6
+ * `[data-dsh-theme="solarized-light"]` is touched.
7
7
  */
8
- .iw-root[data-iw-theme="solarized-light"] {
8
+ [data-dsh-theme="solarized-light"] {
9
9
  --dsw-alias-bg-base: #fdf6e3;
10
10
  --dsw-alias-bg-layer-1: #eee8d5;
11
11
  --dsw-alias-bg-layer-2: #f5eedc;