dsh-code-server-app 0.3.43 → 0.3.45

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.en.md CHANGED
@@ -10,7 +10,7 @@
10
10
  > - Microsoft **open-source** extensions (Python, TypeScript debugger, ESLint, …) are mirrored on Open VSX and install normally by search;
11
11
  > - **If you need a proprietary Microsoft extension**: download the `.vsix` from the Marketplace page and install it manually with `code-server --install-extension <file>` (or drop it into `--extensions-dir`).
12
12
 
13
- A static profile plugin (npm package with host + client bundle) that ships the **VS Code server tree** from a [code-server](https://github.com/coder/code-server) release as a **platform-independent dependency package** (pack-time artifact `vendor/vscode` → `@jinsiyu/dshcs-vscode-server`, no install scripts, no postinstall). The code-server **Node service layer is replaced by the plugin's own `lib/launcher.mjs`**: it drives `<tree>/lib/vscode/out/server-main.js` (`loadCodeWithNls()` / `createServer()` / `handleRequest()` / `handleUpgrade()`) directly and re-adds the few HTTP endpoints code-server used to provide (`/healthz`, `/manifest.json`, `/_static/*`, `/proxy/:port`). The 16 native modules (node-pty / @vscode/sqlite3 / spdlog / …) come from `@jinsiyu/dshcs-*-win32-<arch>` platform packages selected automatically per architecture by the platform aggregator. VS Code's inner dependencies and the prebuilt native modules are **all installed by the package manager together with the plugin** — no global npm install, no `bin` configuration, no profile config changes, no second install command, **no argon2/C++ toolchain**.
13
+ A static profile plugin (npm package with host + client bundle) that ships the **VS Code server tree** from a [code-server](https://github.com/coder/code-server) release as a **platform-independent dependency package** (pack-time artifact `vendor/vscode` → `@jinsiyu/dshcs-vscode-server`, no install scripts, no postinstall). The code-server **Node service layer is replaced by the plugin's own `lib/launcher.mjs`**: it drives `<tree>/lib/vscode/out/server-main.js` (`loadCodeWithNls()` / `createServer()` / `handleRequest()` / `handleUpgrade()`) directly and re-adds the few HTTP endpoints code-server used to provide (`/healthz`, `/manifest.json`, `/_static/*`, `/proxy/:port`). The 16 native modules (node-pty / @vscode/sqlite3 / spdlog / …) come from `@jinsiyu/dshcs-*` sub-packages declared **directly on the plugin's dependency table** under their real names (os/cpu-gated per target), with the original import names restored by runtime junctions. VS Code's inner dependencies and the prebuilt native modules are **all installed by the package manager together with the plugin** — no global npm install, no `bin` configuration, no profile config changes, no second install command, **no argon2/C++ toolchain**.
14
14
 
15
15
  > Since 0.3.22 the ask panel renders the session's new content with **DSH's own Markdown renderer** (the same
16
16
  > renderer and design tokens as the DSH UI; new content only) and can **answer approval requests in place**
@@ -390,11 +390,12 @@ Diagnostics: `GET /api/code-server/status` exposes
390
390
  "Install the plugin (script-free install; code-server bundled)" below — `pnpm install` → `pnpm run build:client` →
391
391
  `pnpm run vendor:vscode` → `pnpm pack` + `dsh plugin --profile web add`.
392
392
 
393
- > Verified locally (BM: Windows 11 ARM64): the whole tree/dependency chain is supplied by per-platform
394
- > sub-packages — the tree package `@jinsiyu/dshcs-vscode-server` (currently 4.137.0, a 50.8 MB tarball),
395
- > the pure-JS inner dependencies directly in the plugin's `dependencies`, and 16 prebuilt native modules
396
- > re-exported under their original names by the aggregator `@jinsiyu/dsh-code-server-runtime-win32-<arch>`
397
- > (picked by os/cpu) → healthz 200 → stopped → fully recycled.
393
+ > Verified locally (BM: Windows 11 ARM64): the whole tree/dependency chain hangs directly off the plugin's
394
+ > dependency table — the tree package `@jinsiyu/dshcs-vscode-server` (currently 4.137.0, a 50.8 MB tarball),
395
+ > the pure-JS inner dependencies plus the 8 platform-independent repacks in `dependencies`, and the 8
396
+ > platform-specific repacks (win32-arm64 / win32-x64) in `optionalDependencies` with their own os/cpu gates;
397
+ > the original names are restored by junctions created at runtime (`lib/native.js`)
398
+ > → healthz 200 → stopped → fully recycled.
398
399
  > (The 0.1.37-era "one big platform package" layout is gone — see "Upgrading the VS Code tree" below.)
399
400
 
400
401
  ## Packaging (how to build the tarball)
@@ -419,7 +420,7 @@ pnpm run promote -- <version>
419
420
  > `pnpm run promote -- <version>` (= `npm dist-tag add dsh-code-server-app@<version> latest`)
420
421
  > **after the user restarts `dsh web` and confirms it works**. That way
421
422
  > `dsh plugin add dsh-code-server-app` (no version) — and anything else resolving `latest` — never picks up an
422
- > unverified build. Sub-packages (`@jinsiyu/dshcs-*`, the aggregators) are referenced by exact/caret versions,
423
+ > unverified build. Sub-packages (`@jinsiyu/dshcs-*`) are referenced by exact versions,
423
424
  > so their dist-tags do not affect resolution, but they default to `next` as well.
424
425
  > Inspect the current tags with `npm dist-tag ls dsh-code-server-app`.
425
426
 
@@ -436,8 +437,8 @@ pnpm run promote -- <version>
436
437
  | Sub-package | Content | os/cpu |
437
438
  |---|---|---|
438
439
  | `@jinsiyu/dshcs-vscode-server@<code-server version>` | the trimmed VS Code tree (`lib/vscode` + `out/browser` + `src/browser`; **without** code-server's `out/node` and its 136 runtime deps) | platform-independent |
439
- | `@jinsiyu/dshcs-<name>[-win32-<arch>]` ×24 | the VS Code inner packages that need building (node-pty / @vscode/sqlite3 / kerberos / koffi / ssh2 / …) | gated when platform-specific |
440
- | `@jinsiyu/dsh-code-server-runtime-win32-<arch>` | platform aggregator: its `dependencies` map those 16 natives back to their original names via `npm:` aliases | win32-<arch> |
440
+ | `@jinsiyu/dshcs-<name>[-win32-<arch>]` ×16 | the VS Code inner packages that need building (node-pty / @vscode/sqlite3 / kerberos / koffi / ssh2 / …) | gated when platform-specific |
441
+ | `lib/vendored.json` (**not** a package) | the "original name → repack sub-package" table shipped inside the plugin; `lib/native.js` uses it to create the junctions. Since 0.3.45 there is **no platform aggregator** | — |
441
442
 
442
443
  | Goal | Command |
443
444
  |---|---|
@@ -445,7 +446,7 @@ pnpm run promote -- <version>
445
446
  | **Pin a version** | `pnpm run vendor:vscode -- --version 4.137.0` |
446
447
  | **Snapshot from an existing tree** | `pnpm run vendor:vscode -- --from <code-server dir>` (seconds) |
447
448
  | **Rebuild every sub-package** | `pnpm run repack:build -- --target win32-arm64,win32-x64 --pack` (without `--from` it npm-installs and compiles the source tree itself — slow) |
448
- | **Rebuild only the tree/aggregator packages** | `node scripts/vendor-repacks.mjs --reuse --target win32-arm64,win32-x64 --pack` (reuses the natives already in `repack/build`) |
449
+ | **Rebuild only the tree + dependency table** | `node scripts/vendor-repacks.mjs --reuse --target win32-arm64,win32-x64 --pack` (reuses the natives already in `repack/build`; also rewrites `lib/vendored.json` and the plugin dependency table) |
449
450
  | **Publish sub-packages** | `pnpm run publish:repacks` (`--dry-run` to preview; `--only <substr>` to filter; `--otp <code>` / `--limit N` for 2FA) |
450
451
  | **Publish the plugin itself** | `pnpm run publish:plugin` (publishes the exact tarball that was verified; no re-packing; default dist-tag `next`) |
451
452
  | **Promote `latest`** | `pnpm run promote -- <version>` (only after the user restarted and confirmed; `--dry-run` shows the current tags first) |
@@ -474,10 +475,13 @@ The main package is only **~110KB** (the plugin's own code plus the launcher); e
474
475
  `@jinsiyu/dshcs-code-server/code-server` is still recognised as a fallback);
475
476
  - the **pure-JS part** of VS Code's inner dependencies (35 packages: xterm / katex / typescript / ws / tar …) is
476
477
  declared in the plugin's `dependencies` and installed by pnpm into the profile's `node_modules` (hoisted);
477
- - the **binary part** comes entirely from `@jinsiyu/dshcs-*` platform packages: 16 native packages mapped back to their
478
- **original names** (`node-pty` / `@vscode/sqlite3` / `@vscode/spdlog` / …) by the **platform aggregator**
479
- `@jinsiyu/dsh-code-server-runtime-win32-<arch>` using `npm:` aliases; the aggregators sit in the plugin's
480
- `optionalDependencies`, so pnpm auto-selects the right platform;
478
+ - the **binary part** comes entirely from `@jinsiyu/dshcs-*` sub-packages, declared **directly on the plugin's own
479
+ dependency table** (since 0.3.45): the 8 platform-independent repacks (`node-pty` / `koffi` / `ssh2` /
480
+ `cpu-features` / `@parcel/watcher` / `@vscode/fs-copyfile` / `@vscode/proxy-agent` / `@microsoft/mxc-sdk`) go into
481
+ `dependencies` under their real names; the 8 platform-specific ones (`@vscode/sqlite3` / `spdlog` / `kerberos` /
482
+ `deviceid` / `native-watchdog` / `windows-registry` / `windows-process-tree` / `windows-ca-certs`) go into
483
+ `optionalDependencies` once per target (real names + their own os/cpu gates), so one command picks the right arch;
484
+ the **original names** are restored at runtime by junctions created from `lib/vendored.json`;
481
485
  - consequently the dependency graph contains **no package with pre/install/postinstall or a `binding.gyp`** →
482
486
  no profile `allowBuilds`, no build script ever runs, and **the user machine needs no C++ toolchain**;
483
487
  - **upgrading the plugin no longer re-downloads the tree**: the tree package is cached by version
@@ -500,10 +504,15 @@ The main package is only **~110KB** (the plugin's own code plus the launcher); e
500
504
  **removed** (the built `.node` and every runtime file stay) → sibling packages in its dependency list become `npm:`
501
505
  aliases → platform-specific ones get `os`/`cpu` plus a `-<platform>-<arch>` suffix. For win32 targets the script also
502
506
  verifies each `.node` PE machine (0x8664=x64 / 0xaa64=arm64) so a cross-compiled artifact cannot ship the wrong arch;
503
- - **the platform aggregator** maps those repacks back to their original names (e.g.
504
- `"node-pty": "npm:@jinsiyu/dshcs-node-pty@1.2.0-beta.15"`), so VS Code's `import('node-pty')` needs no change; the
505
- aggregator is itself `os`/`cpu` gated, and the plugin declares both win32-arm64 and win32-x64 in
506
- `optionalDependencies`, so one command picks the right one;
507
+ - **how the original names come back** (since 0.3.45): a repack's real name is `@<scope>/dshcs-<name>` while VS Code
508
+ imports `node-pty` / `@vscode/sqlite3`; pack time writes the "original name → real name" table into
509
+ `lib/vendored.json` (shipped with the plugin) and `lib/native.js` creates `<tree>/node_modules/<original name>`
510
+ junctions to the real directories (idempotent, self-healing).
511
+ **Why the old "platform aggregator + `npm:` aliases" is gone**: pnpm's incremental hoisted install drops those
512
+ aliased packages when they sit inside an **optional subtree** (measured: 9 of 16 missing) while dsh-desktop
513
+ validates the dependency graph right after the install ⇒ the first install always failed with `requires missing`;
514
+ with real-name direct dependencies the same install command plus the validator's own predicate passes end to end
515
+ (reproduction in `docs/desktop-first-install-root-cause.md`);
507
516
  - **resolution path**: the host finds the tree with `require.resolve('@jinsiyu/dshcs-vscode-server/package.json')`
508
517
  (then the inner `vscode/` directory) and the entry is `vscode/lib/vscode/out/server-main.js`; VS Code's inner deps are
509
518
  resolved upwards from that root (`vscode/lib/vscode/node_modules` → package `node_modules` → `<profile>/node_modules`).
@@ -511,8 +520,8 @@ The main package is only **~110KB** (the plugin's own code plus the launcher); e
511
520
  - **runtime layout self-healing** (`ensureRuntimeLayout()` in `lib/native.js`, idempotent, run **at activation before
512
521
  `envCheck` and again before every start**): the host adds two kinds of **junctions** (Windows junctions / POSIX dir
513
522
  symlinks) into the tree:
514
- 1. `ensureAliasLinks()`: re-links the native aliases the aggregator carries into `<tree>/node_modules` — pnpm nests
515
- `os`/`cpu`-gated packages under the aggregator's own `node_modules`, and `lib/vscode/out/server-main.js` uses
523
+ 1. `ensureAliasLinks()`: links the 16 **original names** listed in `lib/vendored.json` into `<tree>/node_modules`
524
+ — the real-name packages live in the plugin's dependency graph, and `lib/vscode/out/server-main.js` uses
516
525
  **ESM imports** (ESM ignores `NODE_PATH`), so a missing link means an immediate 500;
517
526
  2. `ensureInnerModuleLinks()`: restores VS Code's **inner dependency directories**
518
527
  `lib/vscode/node_modules` and `lib/vscode/extensions/node_modules` from the two `package.json` files — the trimmed
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
  无安装脚本、无 postinstall);**code-server 的 Node 服务层已由插件自带的 `lib/launcher.mjs` 取代**
16
16
  (它直接驱动 `<树>/lib/vscode/out/server-main.js` 的 `loadCodeWithNls()` / `createServer()` / `handleRequest()` /
17
17
  `handleUpgrade()`,并补上 `/healthz`、`/manifest.json`、`/_static/*`、`/proxy/:port` 这几条 code-server 原本提供的 HTTP 面);
18
- 原生模块(node-pty / @vscode/sqlite3 / spdlog …)由 `@jinsiyu/dshcs-*-win32-<架构>` 平台包经聚合包按架构自动选中 ——
18
+ 原生模块(node-pty / @vscode/sqlite3 / spdlog …)由 `@jinsiyu/dshcs-*` 子包按**真名直接挂在插件依赖上**、按 os/cpu 自动选中 ——
19
19
  **无需全局 npm 安装、无需配置 `bin`、无需改 profile 配置、无需第二条安装命令、无需 argon2/C++ 工具链**。
20
20
 
21
21
  > 0.2.0 起:**argon2 与 code-server 的 136 个运行时依赖(express / proxy-agent / js-yaml / pem / limiter …)
@@ -365,10 +365,11 @@ host 反向请求不到它。所以编辑器状态只能在扩展主动发起的
365
365
  "打包(如何出包)"执行 `pnpm install` → `pnpm run build:client` → `pnpm run vendor:vscode` →
366
366
  (发布预编译原生包)→ `pnpm pack` + `dsh plugin --profile web add` 即可。
367
367
 
368
- > 本机(BM: Windows 11 ARM64)实测:树/依赖全链路是"平台子包 + 聚合包"供给 ——
369
- > 树包 `@jinsiyu/dshcs-vscode-server`(当前 4.137.0,50.8 MB tgz)、纯 JS 内部依赖直接进插件
370
- > `dependencies`、16 个预编译原生包经平台聚合包 `@jinsiyu/dsh-code-server-runtime-win32-<arch>`
371
- > (按 os/cpu 自动选)装回原名 → healthz 200 → 停止 → 回收全链路验证。
368
+ > 本机(BM: Windows 11 ARM64)实测:树/依赖全链路是"平台子包直挂插件依赖"供给 ——
369
+ > 树包 `@jinsiyu/dshcs-vscode-server`(当前 4.137.0,50.8 MB tgz)、纯 JS 内部依赖与 8 个平台无关
370
+ > 重打包包直接进插件 `dependencies`、8 个平台专属重打包包按 win32-arm64/x64 进
371
+ > `optionalDependencies`(包自带 os/cpu 自动选),原始名字由 `lib/native.js` 补 junction 还原
372
+ > → healthz 200 → 停止 → 回收全链路验证。
372
373
  > (0.1.37 时代的主包形态已废弃,见下方"升级 VS Code 树"。)
373
374
 
374
375
  ## 打包(如何出包)
@@ -398,8 +399,18 @@ pnpm run promote -- <version>
398
399
  > `latest` 只保留「最近一个确认无 bug 的版本」,由 `pnpm run promote -- <version>`
399
400
  > (= `npm dist-tag add dsh-code-server-app@<version> latest`)在**用户重启 dsh web 确认无误后**才推进。
400
401
  > 这样 `dsh plugin add dsh-code-server-app`(不带版本)和任何按 latest 安装的流程都不会拿到未验证的版本。
401
- > 子包(`@jinsiyu/dshcs-*`、聚合包)被依赖以精确/插入符版本引用,dist-tag 不影响解析,但同样默认发 `next`。
402
+ > 子包(`@jinsiyu/dshcs-*`)被依赖以**精确版本**引用(平台专属的按目标各钉一份),dist-tag 不影响解析,但同样默认发 `next`。
402
403
  > 查看当前标签:`npm dist-tag ls dsh-code-server-app`。
404
+ >
405
+ > **desktop profile 不走命令行安装**(2026-09-13 起的约定):对 desktop 只做 `pnpm pack` + `publish:plugin`(发 `next`),
406
+ > 由用户在 DSH Desktop 里用**官方安装方式**自行安装;不要再把 tarball 文件级覆盖进 `~/.dsh/profiles/desktop` ——
407
+ > 那条路会绕过 desktop 应用自己的依赖闭包检查,把真实的解析问题掩盖成"装上了但行为怪"。
408
+ > web profile 仍可照旧安装验证。
409
+ >
410
+ > **0.3.45 起没有平台聚合包**,`requires missing @microsoft/mxc-sdk@npm:…` 那类报错不会再出现。根因(实测):
411
+ > pnpm 的**增量 hoisted 安装**会漏链「可选子树里的 `npm:` 别名包」,16 个里漏 9 个(第一个就是 mxc-sdk),而
412
+ > dsh-desktop 在 `pnpm add` 之后**立刻**校验依赖图 ⇒ 首次安装必失败;重启后应用走「删 node_modules + 完整安装」
413
+ > 才补齐 ⇒ 就是你看到的"重启自己装好了"。复现命令与两条修法见 `docs/desktop-first-install-root-cause.md`。
403
414
 
404
415
  `repack:build`(`scripts/vendor-repacks.mjs`)是**唯一的子包产出脚本**,一次生成:
405
416
 
@@ -407,7 +418,7 @@ pnpm run promote -- <version>
407
418
  |---|---|---|
408
419
  | `@jinsiyu/dshcs-vscode-server@<code-server 版本>` | 精简 VS Code 树(`lib/vscode` + `out/browser` + `src/browser`,**不含** code-server 的 `out/node` 与 136 个运行时依赖) | 平台无关 |
409
420
  | `@jinsiyu/dshcs-<名字>[-win32-<arch>]` ×16 | VS Code 内部依赖里需要构建的原生包(node-pty / @vscode/sqlite3 / kerberos / koffi / ssh2 / spdlog / …) | 平台专属带 os/cpu |
410
- | `@jinsiyu/dsh-code-server-runtime-win32-<arch>` | 平台聚合包:`dependencies` 用 `npm:` 别名把上面 16 个原生包装回原始名字 | win32-<arch> |
421
+ | `lib/vendored.json`(**不是包**) | 「原名 → 重打包子包」表,随插件发布;运行时由 `lib/native.js` 据此补 junction。0.3.45 起**不再产出平台聚合包** | — |
411
422
 
412
423
  > argon2 已随 code-server 服务层一起移除(0.2.0):`auth` 固定 `none`,需要对外访问请用 `serve: dsh`。
413
424
 
@@ -418,7 +429,7 @@ pnpm run promote -- <version>
418
429
  | **从已装好的树快照** | `pnpm run vendor:vscode -- --from <code-server 目录>`(秒级) |
419
430
  | **开发期让树可直接跑** | `pnpm run vendor:vscode -- --dev-links`(额外把 `lib/vscode/node_modules` 用 junction 补上) |
420
431
  | **完整重打子包** | `pnpm run repack:build -- --target win32-arm64,win32-x64 --pack`(不给 `--from` 会自动 npm install 解包 + 编译,耗时) |
421
- | **只重打树包/聚合包** | `node scripts/vendor-repacks.mjs --reuse --target win32-arm64,win32-x64 --pack`(复用 `repack/build` 里已有的原生包,不重新分析源树) |
432
+ | **只重打树包 + 依赖表** | `node scripts/vendor-repacks.mjs --reuse --target win32-arm64,win32-x64 --pack`(复用 `repack/build` 里已有的原生包,不重新分析源树;顺带重写 `lib/vendored.json` 与插件依赖表) |
422
433
  | **发布子包** | `pnpm run publish:repacks`(`--dry-run` 预览;`--only <子串>` 过滤;`--otp <code>` / `--limit N` 应对 2FA) |
423
434
  | **发布插件本体** | `pnpm run publish:plugin`(发布**已验证过的那份 tarball**,不会重新打包;默认 dist-tag = `next`) |
424
435
  | **推进 latest** | `pnpm run promote -- <version>`(用户重启确认无误后;`--dry-run` 先看当前标签) |
@@ -439,6 +450,7 @@ pnpm test:webview # 面板 webview 产物:官方渲染器与令牌打
439
450
  pnpm test:launcher-routes # launcher 的 HTTP 面(起真进程,较慢)
440
451
  pnpm test:workspace-switch # 切工作区不重启进程
441
452
  pnpm test:fullscreen # 打开标签即全屏
453
+ pnpm test:vendored # 重打包表 ↔ 插件依赖表一致(无 npm: 别名 / 无聚合包 / vendored.json 进了 files)
442
454
  ```
443
455
 
444
456
  > `test:bridge-routes` 会把 `DSH_HOME` 指向临时目录(否则它会 adopt 开发机上正在跑的那个实例,
@@ -461,9 +473,13 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-
461
473
  `<profile>\node_modules\@jinsiyu\dshcs-vscode-server\vscode`;
462
474
  - VS Code 内部依赖里**纯 JS 的部分**(35 个:xterm / katex / typescript / ws / tar …)也写在插件
463
475
  `dependencies`,由 pnpm 装到 profile 的 `node_modules`(hoisted);
464
- - **二进制部分**全部由 `@jinsiyu/dshcs-*` 平台包提供(每个平台各一份,os/cpu 限定):
465
- 16 个原生包经**平台聚合包** `@jinsiyu/dsh-code-server-runtime-win32-<arch>` 用 `npm:` 别名装回**原始名字**
466
- (`node-pty` / `@vscode/sqlite3` / `@vscode/spdlog` / …),聚合包挂在插件 `optionalDependencies` → pnpm 按架构自动选;
476
+ - **二进制部分**全部由 `@jinsiyu/dshcs-*` 子包提供,且**直接挂在插件依赖上**(0.3.45 起):
477
+ 平台无关的 8 个(`node-pty` / `koffi` / `ssh2` / `cpu-features` / `@parcel/watcher` /
478
+ `@vscode/fs-copyfile` / `@vscode/proxy-agent` / `@microsoft/mxc-sdk`)写进插件 `dependencies`(真名);
479
+ 平台专属的 8 个(`@vscode/sqlite3` / `spdlog` / `kerberos` / `deviceid` / `native-watchdog` /
480
+ `windows-registry` / `windows-process-tree` / `windows-ca-certs`)按 win32-arm64 与 win32-x64
481
+ 各一份写进 `optionalDependencies`(真名 + 包自带 os/cpu)→ 一条命令自动选对架构;
482
+ **原始名字**由 `lib/native.js` 运行时补 junction 还原(见下「运行时布局自愈」);
467
483
  - 因此依赖图里**没有任何带 pre/install/postinstall 或 binding.gyp 的包** →
468
484
  不需要 profile 的 `allowBuilds`、不执行任何构建、**使用者机器不需要 C++ 工具链**;
469
485
  - **升级插件不再重下树**:树包版本按上游 code-server 版本缓存,pnpm 直接复用(约 60MB,解包 ≈197MB)。
@@ -484,18 +500,21 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app\dsh-code-
484
500
  (保留编译好的 `.node` 与全部运行时文件)→ 依赖里的同集包改成 `npm:` 别名 → 平台专属的加
485
501
  `os`/`cpu` 与 `-<platform>-<arch>` 后缀;win32 目标还会校验 `.node` 的 PE machine
486
502
  (0x8664=x64 / 0xaa64=arm64),防交叉编译产物装错架构;
487
- - **平台聚合包**把重打包包按原始名字装回去(如 `"node-pty": "npm:@jinsiyu/dshcs-node-pty@1.2.0-beta.15"`),
488
- 于是 VS Code 的 `import('node-pty')` 不用改;聚合包本身 `os`/`cpu` 限定,
489
- 插件 `optionalDependencies` 同时声明 win32-arm64 与 win32-x64 两份 → 一条命令自动选对;
503
+ - **原始名字怎么还原**(0.3.45 起):重打包包的真名是 `@<scope>/dshcs-<名字>`,而 VS Code `import` 的是
504
+ `node-pty` / `@vscode/sqlite3` 这类**原名**;打包期把「原名 → 真名」写进 `lib/vendored.json`(随插件发布),
505
+ 运行时由 `lib/native.js` 在 `<树>/node_modules/<原名>` 补 junction 指向真名包(幂等、可自愈)。
506
+ **为什么不再用「平台聚合包 + `npm:` 别名」**:pnpm 的增量 hoisted 安装会漏链**可选子树**里的别名包
507
+ (实测 16 个漏 9 个),而 dsh-desktop 安装后立刻校验依赖图 ⇒ 首次安装必报 requires missing;
508
+ 改成真名直接依赖后,同一条安装命令 + 校验器判据实测全部通过(复现见 `docs/desktop-first-install-root-cause.md`);
490
509
  - **解析路径**:host 用 `require.resolve('@jinsiyu/dshcs-vscode-server/package.json')` 找到运行根
491
510
  (包内子目录 `vscode/`),入口 `vscode/lib/vscode/out/server-main.js`;VS Code 内部依赖从该运行根向上查找
492
511
  (`vscode/lib/vscode/node_modules` → 包 `node_modules` → `<profile>/node_modules`)。
493
512
  (旧全量树 `@jinsiyu/dshcs-code-server/code-server` 仍作为回退被识别。)
494
513
  - **运行时布局自愈**(`lib/native.js` 的 `ensureRuntimeLayout()`,**激活时(先于 envCheck)与每次启动前**幂等执行):
495
514
  host 会在 VS Code 树里补两类 **junction**(Windows junction / POSIX 目录软链):
496
- 1. `ensureAliasLinks()`:把聚合包带回的原生别名补到 `<树>/node_modules`
497
- —— pnpm 会把 `os`/`cpu` 限定的包**嵌套装在聚合包自己的 node_modules 下**,而 VS Code 的
498
- `lib/vscode/out/server-main.js` 用 **ESM import**(ESM 不认 `NODE_PATH`),缺了就直接 500;
515
+ 1. `ensureAliasLinks()`:按 `lib/vendored.json` 把 16 个**原始名字**补到 `<树>/node_modules`
516
+ —— 真名子包装在插件依赖图里,而 VS Code 的 `lib/vscode/out/server-main.js` 用 **ESM import**
517
+ (ESM 不认 `NODE_PATH`),缺了就直接 500;
499
518
  2. `ensureInnerModuleLinks()`:把 VS Code 的**内部依赖目录** `lib/vscode/node_modules` 与
500
519
  `lib/vscode/extensions/node_modules` 按两个 `package.json` 的 `dependencies` 补回老布局
501
520
  —— 精简树里没有这两个目录,**用显式路径拼依赖的代码**
@@ -531,7 +550,7 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
531
550
 
532
551
  > 源码路径以 `link:` 安装。开发机上没有 `vendor/vscode` 时先 `pnpm run vendor:vscode -- --dev-links`;
533
552
  > 没有平台子包时 host 会回退到包内 `vendor/code-server`(两种布局都支持)。
534
- > 依赖(内部 JS 依赖 + 平台子包 + 聚合包)同样由 pnpm 安装 —— 本地未发布的 `@jinsiyu/*` 需先发布,
553
+ > 依赖(内部 JS 依赖 + 重打包子包)同样由 pnpm 安装 —— 本地未发布的 `@jinsiyu/*` 需先发布,
535
554
  > 或把 `repack/tgz/*.tgz` 以 `file:` 依赖临时装进 profile(见 `.tmp-verify.mjs`)。
536
555
  >
537
556
  > **改动 client bundle**:编辑 `src/factory.js` 后执行 `pnpm run build:client`
@@ -582,7 +601,8 @@ dsh plugin --profile web add C:\Users\User\Desktop\dsh-code-server-app
582
601
  - **换版本后重新出子包并发布**(全部由同一个脚本):
583
602
  1. `pnpm run repack:build -- --target win32-arm64,win32-x64 --pack` → 新的树包
584
603
  (`@jinsiyu/dshcs-vscode-server@<新版本>`)以及按新内部依赖重建的原生包
585
- (脚本会把新的「纯 JS 直装集」写进插件 `dependencies`、更新两个聚合包版本);
604
+ (脚本会把新的「纯 JS 直装集」写进插件 `dependencies`,并把 16 个重打包包按真名写进
605
+ `dependencies` / `optionalDependencies`、重写 `lib/vendored.json`);
586
606
  2. `pnpm run publish:repacks` → 发布;然后 bump 插件版本 → `pnpm pack` → 发布插件。
587
607
  - `productPath`(`<quality>-<commit>`,客户端 WS 路径的组成)**从 `lib/vscode/product.json` 现算**,
588
608
  升级树后无需改代码 —— 但也意味着切版本后必须重启 dsh web(路由在激活期注册)。
@@ -612,7 +632,7 @@ host 探测顺序:`@jinsiyu/dshcs-vscode-server/vscode`(**0.2.0+ 正式布局**)
612
632
 
613
633
  0.2.7 起卡片**没有**「入口」「依赖安装」「环境检测」三行:入口在右侧栏「开始」页的 Code Server 入口框(或官方的文件点击),
614
634
  诊断信息不再进 UI —— `/api/code-server/status` 的 `env` 字段仍返回
615
- 树版本 / `productPath` / server 入口、VS Code 内部依赖、**预编译原生包**(平台聚合包名 + 已解析模块数),需要时用脚本查或看 host 日志。
635
+ 树版本 / `productPath` / server 入口、VS Code 内部依赖、**预编译原生包**(重打包子包名 + 已解析模块数),需要时用脚本查或看 host 日志。
616
636
 
617
637
  > 卡片改动经 `scope.watch` 实时生效(host 端 status API 同步返回 `keepResident`、`claimExtensions` 与
618
638
  > `fullscreenOnOpen`,客户端立即生效);无需重启 dsh。**新增设置键后首次使用前需重启 dsh web**,
@@ -2,7 +2,7 @@
2
2
  "name": "dshcs-editor-bridge",
3
3
  "displayName": "DSH Editor Bridge",
4
4
  "description": "只读地把编辑器状态(未保存缓冲区、诊断、活动选区)提供给 DSH;右键提问打开 DSH 页面里的悬浮对话对话框(0.2.5;老宿主退回编辑器面板),正文/思考/上下文都用 DSH 官方渲染器,并可就地回答授权请求。由 dsh-code-server-app 插件安装,可禁用。",
5
- "version": "0.2.14",
5
+ "version": "0.2.15",
6
6
  "publisher": "dsh-code-server-app",
7
7
  "license": "MIT",
8
8
  "private": true,
@@ -11,7 +11,7 @@
11
11
  | react | 18.3.1 | MIT |
12
12
  | react-dom | 18.3.1 | MIT |
13
13
 
14
- 生成时间:2026-09-13T13:18:21.529Z
14
+ 生成时间:2026-09-13T13:24:35.092Z
15
15
  渲染器:@deepseek-ai/dsh-client-ui-primitives@0.1.5-rc.2(DSH 部署的界面版本:0.1.5-rc.2)
16
16
  设计令牌:@deepseek-ai/dsh-client-ui-theme@0.1.5-rc.2(11 段)
17
17
  KaTeX:已打包(公式排版与 DSH 界面一致)
@@ -133,10 +133,18 @@ function App() {
133
133
  if (node !== null && stickRef.current) node.scrollTop = node.scrollHeight;
134
134
  }, [view.entries]);
135
135
 
136
- // 宿主状态回来了就解除"发送中"的按钮锁。
136
+ // 任何一趟宿主状态回来都解除"发送中"的按钮锁(0.3.44)。
137
+ // 老写法盯着 `view.status` 变化 —— 而对话框形态下宿主回的 status **一直是 'idle'**,
138
+ // 于是那个 effect 永远不再触发:第一次发送之后按钮就永久变灰(实测"只能发送一次,没法追问")。
137
139
  useEffect(() => {
138
- if (view.status !== 'sending') setSending(false);
139
- }, [view.status]);
140
+ setSending(false);
141
+ }, [view]);
142
+ // 兜底:万一某一趟状态没回来(宿主卡住/请求失败),最多 15 秒也把锁解开。
143
+ useEffect(() => {
144
+ if (sending !== true) return undefined;
145
+ const timer = window.setTimeout(() => setSending(false), 15000);
146
+ return () => window.clearTimeout(timer);
147
+ }, [sending]);
140
148
 
141
149
  const onScroll = () => {
142
150
  const node = logRef.current;