dsh-code-server-app 0.3.66 → 0.3.67

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
@@ -708,6 +708,10 @@ pnpm test:installed # install smoke: assert on what was **installed int
708
708
  # (default <DSH_HOME>/profiles/web): every `files` entry present, repack
709
709
  # packages complete for this platform, no missing natives, the installed
710
710
  # copy imports, the tree is in place — nothing the repo suite can see
711
+ pnpm test:metadata # plugin-page icon & copy contract: icon relativeness / media-type whitelist /
712
+ # realpath inside the package / ≤256 KiB / covered by `files`; dictionary
713
+ # en.json anchor, language ids, identical key sets, copy length caps, and the
714
+ # silent "dictionaries must be exported" guard
711
715
  ```
712
716
 
713
717
  **The dist-tag policy is unchanged**: `release.yml` only publishes `next` and never touches `latest`; `latest` is
@@ -1110,6 +1114,22 @@ guide page (and in DSH's own file clicks), and diagnostics stay out of the UI
1110
1114
  reports the tree version / `productPath` / server entry, VS Code inner dependencies and **prebuilt native packages**
1111
1115
  (platform aggregator name + resolved module count) for scripts, and the DSH host log carries the `[code-server]` lines.
1112
1116
 
1117
+ ### Plugin-page icon and copy (since 0.3.67)
1118
+
1119
+ The **icon and the title/description of the plugin row and card are resolved by the host from package metadata** —
1120
+ they are not drawn by our client half:
1121
+
1122
+ | Item | Source | Hard constraints (host `readPluginMeta` / `iconOf`) |
1123
+ |---|---|---|
1124
+ | Icon | `package.json` top-level `"icon": "./assets/favicon.svg"` | must be a **relative path** (absolute paths or any scheme throw); extension must be **svg / png / jpg / jpeg / webp**; must stay inside the package directory after realpath; must be a regular file; **≤ 256 KiB**. The host inlines it as `data:…;base64` for the client's `<img src>` |
1125
+ | Title / description | `locale/en.json` (the anchor) plus `locale/zh.json`, shaped `{"meta":{"title":…,"description":…}}` | filenames must be language ids and are de-duplicated case-insensitively; **without `en.json` there are no dictionaries at all**; dictionaries are located through the **module resolver**, so `exports` must expose `./locale/*.json` |
1126
+
1127
+ Two **silent failure modes** (the UI says nothing, it just degrades): an illegal or missing icon falls back to the
1128
+ placeholder artwork; dictionaries that are not exported leave the English UI showing the 2000-character
1129
+ `description` from `package.json` (that one is for the npm page — plugin-page copy always comes from the
1130
+ dictionaries). Regression: `pnpm test:metadata` (`scripts/test-plugin-metadata.mjs`, which also pins the
1131
+ "dictionaries must be exported" and "copy length caps" traps).
1132
+
1113
1133
  ## Config (`config` in cordis.patch.yml; all have defaults)
1114
1134
 
1115
1135
  | Key | Default | Description |
package/README.md CHANGED
@@ -572,6 +572,8 @@ pnpm test:package-files # 发布物白名单守卫:files 里的模块**递
572
572
  pnpm test:installed # 安装冒烟:对**已装进 profile 的产物**做断言(默认 <DSH_HOME>/profiles/web)
573
573
  # files 白名单每条都在 / 重打包包在当前平台齐全 / 原生模块无缺失 /
574
574
  # 已安装副本能 import / 树在位 —— 仓库回归看不出这一类
575
+ pnpm test:metadata # 插件页图标与文案守约:icon 的相对性/格式白名单/包内 realpath/≤256 KiB/files 覆盖,
576
+ # 词典的 en.json 锚点/语言 id/键集一致/长度上限,以及"词典必须在 exports 里"这条静默失败守卫
575
577
  ```
576
578
 
577
579
  > `test:bridge-routes` 会把 `DSH_HOME` 指向临时目录(否则它会 adopt 开发机上正在跑的那个实例,
@@ -1068,6 +1070,19 @@ host 探测顺序:`@jinsiyu/dshcs-vscode-server/vscode`(**0.2.0+ 正式布局**)
1068
1070
  > 与 `fullscreenOnOpen`,客户端立即生效。**新增设置键后首次使用前需重启 dsh web**:
1069
1071
  > 新线的表单只展示**活动且可唯一定位**的条目里的 **volatile** 字段,旧线要重新注册设置命名空间。
1070
1072
 
1073
+ ### 插件页的图标与文案(0.3.67 起)
1074
+
1075
+ 插件页那一行/那张卡的**图标与标题描述由宿主从包元数据解析**,不是我们画在客户端里的:
1076
+
1077
+ | 项 | 来源 | 硬约束(宿主 `readPluginMeta` / `iconOf`) |
1078
+ |---|---|---|
1079
+ | 图标 | `package.json` 顶层 `"icon": "./assets/favicon.svg"` | 必须**相对路径**(绝对路径或带 scheme 一律抛错);扩展名只认 **svg / png / jpg / jpeg / webp**;realpath 后必须留在包目录内;必须是常规文件;**≤ 256 KiB**。宿主转成 `data:…;base64` 交给前端 `<img src>` |
1080
+ | 标题 / 描述 | `locale/en.json`(锚点)+ `locale/zh.json`,格式 `{"meta":{"title":…,"description":…}}` | 文件名必须是语言 id 且按小写去重;**`en.json` 缺了就等于没有词典**;词典经**模块解析器**定位 ⇒ `exports` 里必须有 `./locale/*.json` |
1081
+
1082
+ 两个**静默失败**模式(界面上什么都不说,只退化):图标非法/缺失 ⇒ 退回占位图形;词典没导出 ⇒
1083
+ 英文界面继续显示 `package.json` 里那段 2000 字的 `description`(那段是给 npm 页面看的,插件页文案一律走词典)。
1084
+ 回归:`pnpm test:metadata`(`scripts/test-plugin-metadata.mjs`,含"词典必须在 `exports` 里""文案长度上限"两条陷阱守卫)。
1085
+
1071
1086
  ## 配置(cordis.patch.yml 的 `config`,均有默认值)
1072
1087
 
1073
1088
  | 键 | 默认 | 说明 |
package/lib/client.js CHANGED
@@ -1241,7 +1241,8 @@ let React = require('react')
1241
1241
  guide: [{
1242
1242
  order: 20,
1243
1243
  title: function () { return 'Code Server' },
1244
- description: function () { return '在右侧栏标签里运行 VS Code 网页版,跟随当前会话工作区;产物/交付文件点击后在此打开。' },
1244
+ // 与插件页文案(locale/zh.json)同一句口径,只多一句本入口的特有信息
1245
+ description: function () { return '在 DSH 右侧栏运行 VS Code 网页版,跟随会话工作区;产物/交付文件(含正文提及)点击后在此打开。' },
1245
1246
  icon: CodeServerIcon,
1246
1247
  }],
1247
1248
  })
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Code Server",
4
+ "description": "VS Code in DSH's right sidebar, following the session workspace; the agent reads unsaved buffers, diagnostics and the active selection."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Code Server",
4
+ "description": "在 DSH 右侧栏运行 VS Code 网页版,跟随会话工作区;agent 可读未保存缓冲区、诊断与选区,编辑器手势可驱动会话。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.3.66",
3
+ "version": "0.3.67",
4
4
  "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs), plus an editor bridge (assets/extensions/dshcs-editor-bridge) that gives the agent what only the editor knows (unsaved buffers, language-server diagnostics, the active selection) and lets editor gestures drive the session. The bridge is completely read-only: all four of its routes (/health, /sync, /old, /event) are reads. Asking DSH from the editor opens a floating dialog inside the DSH page (draggable, resizable, bottom-right): the plugin's client half sends the question as user input (POST /api/code-server/ask/send) and renders that session's new content with DSH's own Markdown renderer - the same @deepseek-ai/dsh-client-ui-primitives instance the UI uses, required from the page's module table, so typography, highlighting and math match the interface and a renderer version mismatch is impossible. Thinking appears as collapsed rows and approval requests (writing outside the workspace / running commands) can be answered in place: whole-plugin write route POST /api/code-server/ask/approve, constrained to pending in-process requests and the outcomes allowed-once/rejected; dialog-first for 5 minutes, handed back to the official card the moment the dialog closes, never auto-approved. There is no build step anywhere: lib/client.js (client half including the dialog panel) and the extension are committed hand-written source, devDependencies holds a single test-only entry, and the published package carries no frontend bundle. Also: the tab claims DSH file addresses (dsh-resource://file/**) by file type (setting claimExtensions), so produced-file chips, delivered-file previews and inline prose mentions open in the workbench; the IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs does not reload it; opening the tab switches the right sidebar to fullscreen by default (setting fullscreenOnOpen); a workspace switch re-navigates the workbench with the new ?folder= without restarting the IDE process. Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions only get an upgrade notice on the settings page. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). The diff the bridge opens always has the real pre-write text on the left, taken from result.value.before in tools/post-execute into a bounded snapshot cache and fetched by opaque key over the read-only GET /old, so files that are not open in the editor work too. No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
@@ -9,9 +9,11 @@
9
9
  },
10
10
  "type": "module",
11
11
  "main": "lib/index.js",
12
+ "icon": "./assets/favicon.svg",
12
13
  "exports": {
13
14
  ".": "./lib/index.js",
14
15
  "./client": "./lib/client.js",
16
+ "./locale/*.json": "./locale/*.json",
15
17
  "./package.json": "./package.json"
16
18
  },
17
19
  "dsh": {
@@ -56,6 +58,8 @@
56
58
  "lib/vendored.json",
57
59
  "assets/favicon.ico",
58
60
  "assets/favicon.svg",
61
+ "locale/en.json",
62
+ "locale/zh.json",
59
63
  "assets/extensions/dshcs-open-file",
60
64
  "assets/extensions/dshcs-editor-bridge",
61
65
  "scripts/vendor-vscode-server.mjs",
@@ -177,6 +181,7 @@
177
181
  "test:dsh-resolve": "node scripts/test-dsh-resolve.mjs",
178
182
  "test:child-node": "node scripts/test-child-node.mjs",
179
183
  "test:package-files": "node scripts/test-package-files.mjs",
184
+ "test:metadata": "node scripts/test-plugin-metadata.mjs",
180
185
  "test:bridge-routes": "node scripts/test-bridge-routes.mjs",
181
186
  "test:edit-snapshot": "node scripts/test-edit-snapshot.mjs",
182
187
  "test:bridge-extension": "node scripts/test-bridge-extension.mjs",
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.138.0",
4
4
  "productPath": "stable-59c988c744a240b05b039f57b856a5312f19d5b1",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-22T13:10:27.713Z",
6
+ "preparedAt": "2026-09-22T14:47:24.370Z",
7
7
  "source": "registry",
8
8
  "node": "v24.20.0",
9
9
  "platform": "linux",