dsh-ide-window 0.3.0 → 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
  ---
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@
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
+
9
18
  ## [0.3.0] — 2026-11-19
10
19
 
11
20
  ### 新增
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
 
@@ -284,7 +285,14 @@ DSH 的 LSP 是可选能力,插件只消费它。没装时进入代码工作
284
285
 
285
286
  ### 手动三步(脚本做的事)
286
287
 
287
- 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
+
288
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/`
289
297
  3. 授权与重启:`~/.dsh/lsp-bin/*/bin/intellij-server license login`,然后完全退出并重开 DSH
290
298
 
@@ -296,7 +304,7 @@ DSH 的 LSP 是可选能力,插件只消费它。没装时进入代码工作
296
304
  **1) 管道包**(版本必须与 DSH 一致)
297
305
 
298
306
  ```sh
299
- 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
300
308
  ```
301
309
 
302
310
  **2) 语言服务器**:IntelliJ 授权版(build `271.2085.0`)放到本机 `~/.dsh/lsp-bin/intellij-server-2027.1/`,然后在 profile 的 `cordis.patch.yml` 里插两行:
@@ -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.3.0",
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",