dsh-plugin-wsl-env 0.28.0 → 0.29.0

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/CHANGELOG.md CHANGED
@@ -16,6 +16,32 @@ were part of the record.
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [0.29.0] - 2026-11-23
20
+
21
+ WSL panel release: diagnosis and repair are separate actions, with clearer
22
+ progress feedback and accessible controls.
23
+
24
+ ### Changed
25
+
26
+ - **Full diagnosis is read-only.** Repairing plugin-owned state now requires a
27
+ separate explicit action, followed by verification; it does not install
28
+ packages or rewrite Windows configuration.
29
+ - **The WSL panel is more concise and accessible.** Detailed guidance starts
30
+ collapsed, and checks/repairs state the current action and possible distro
31
+ startup without inventing progress or elapsed-time estimates. Controls work
32
+ with the keyboard, and status/error updates expose screen-reader semantics.
33
+ - **Release workflow hardening.** The workflow default permission is now
34
+ `contents: read`; only the publish job holds `contents: write` and
35
+ `id-token: write`. The `upload-artifact` and `download-artifact` actions are
36
+ pinned to commit SHAs like the other actions. No plugin runtime behavior
37
+ changed.
38
+
39
+ ### Verification
40
+
41
+ - `pnpm test`, `pnpm run test:coverage`, and `pnpm run test:browser` passed.
42
+ The Windows/WSL real-machine probe suite was not run in this Linux
43
+ environment, which has no WSL or Harness installation.
44
+
19
45
  ## [0.28.0] - 2026-11-22
20
46
 
21
47
  Release-evidence release: the official-package smoke gates publication and
package/client.js CHANGED
@@ -19,13 +19,11 @@
19
19
  * `updateBundle` only for that explicit click and the card reports the host's
20
20
  * applied/restart-required/rollback outcome.
21
21
  *
22
- * Every distro row offers two check actions: **快速检查** (the scoped quick
23
- * doctor, `GET` on the status route) and **完整检查** (the full doctor with
24
- * `--fix-owned`, `POST` on the same route). Both run again on every click —
25
- * there is no persistent "recheck" label. The full run also repairs plugin-owned
26
- * state (a stale session scope or a broken agent cache) and answers with its
27
- * `fix.*` before → after rows; it never installs packages or rewrites
28
- * Windows-owned configuration. Every other warning stays manual.
22
+ * Every distro row offers **快速检查** (the quick doctor) and **完整诊断**
23
+ * (the full doctor, read-only). When a full report identifies plugin-owned
24
+ * state it can repair, the row separately offers **修复插件状态**; that action
25
+ * uses `--fix-owned` and answers with its `fix.*` before → after rows. It never
26
+ * installs packages or rewrites Windows-owned configuration.
29
27
  *
30
28
  * The last result is persisted Host-side, so a page reload (or an app restart)
31
29
  * still shows the last guidance and when it ran. On load, a stored result for
@@ -61,7 +59,7 @@ window.__ModuleLoader__.load({
61
59
  const useState = React.useState;
62
60
  const useEffect = React.useEffect;
63
61
 
64
- /** The plugin's status route (checks on GET, the full check on POST, clear on DELETE); the row registers this exact path. */
62
+ /** The plugin's status route (checks on GET, repair on POST, clear on DELETE); the row registers this exact path. */
65
63
  const STATUS_PATH = "/api/wsl-env/status";
66
64
  /** The plugin version/upgrade route: GET reads, POST performs the confirmed upgrade. */
67
65
  const PLUGIN_UPDATE_PATH = "/api/wsl-env/plugin-update";
@@ -107,11 +105,10 @@ window.__ModuleLoader__.load({
107
105
  };
108
106
 
109
107
  /**
110
- * The doctor route: list/quick check on GET, the full check (which also
111
- * repairs plugin-owned state) on POST, and clearing stored results on
112
- * DELETE.
108
+ * The doctor route: list/quick/full read-only checks on GET, the explicit
109
+ * plugin-owned repair on POST, and clearing stored results on DELETE.
113
110
  * @param query - the query string, including `?`, or empty.
114
- * @param method - `GET` for a check, `POST` for the full-check action,
111
+ * @param method - `GET` for a check, `POST` for repair,
115
112
  * `DELETE` to clear one distro's result (named by `distro`) or all.
116
113
  * @returns the decoded body.
117
114
  */
@@ -545,7 +542,7 @@ window.__ModuleLoader__.load({
545
542
  justifyContent: "space-between",
546
543
  },
547
544
  cardTitle: { fontSize: 13, fontWeight: 600 },
548
- hint: { fontSize: 12, opacity: 0.6 },
545
+ hint: { fontSize: 12, opacity: 0.7 },
549
546
  row: {
550
547
  display: "flex",
551
548
  flexDirection: "column",
@@ -599,7 +596,7 @@ window.__ModuleLoader__.load({
599
596
  fixableTag: { fontSize: 11, color: "#5ecf86", marginLeft: 4, marginRight: 4 },
600
597
  summary: { display: "flex", flexDirection: "column", gap: 3, fontSize: 12 },
601
598
  summaryLine: { display: "flex", flexWrap: "wrap", gap: 10, alignItems: "center" },
602
- summaryMuted: { opacity: 0.55 },
599
+ summaryMuted: { opacity: 0.7 },
603
600
  refreshTag: { fontSize: 12, color: "#e0b04a" },
604
601
  countOk: { color: "#5ecf86" },
605
602
  countWarn: { color: "#e0b04a" },
@@ -729,7 +726,7 @@ window.__ModuleLoader__.load({
729
726
  return h(
730
727
  "section",
731
728
  { style: styles.card },
732
- h("div", { style: styles.cardHead }, h("div", { style: styles.cardTitle }, title), actions ?? null),
729
+ h("div", { style: styles.cardHead }, h("h2", { style: { ...styles.cardTitle, margin: 0 } }, title), actions ?? null),
733
730
  children,
734
731
  );
735
732
  }
@@ -744,11 +741,12 @@ window.__ModuleLoader__.load({
744
741
  if (state.phase === "checking") return h(Pill, { label: "快速检查中…", tone: "idle" });
745
742
  if (state.phase === "fullChecking") {
746
743
  return h(Pill, {
747
- label: "完整检查中…",
744
+ label: "完整诊断中…",
748
745
  tone: "idle",
749
- title: "正在运行完整检查并修复插件自有状态",
746
+ title: "正在运行只读的完整诊断",
750
747
  });
751
748
  }
749
+ if (state.phase === "repairing") return h(Pill, { label: "修复中…", tone: "idle", title: "正在修复插件自有状态并复检" });
752
750
  if (state.phase === "refreshing") return h(Pill, { label: "复核中…", tone: "idle", title: "面板正在后台复核上次结果" });
753
751
  if (state.phase === "error") return h(Pill, { label: "无法检查", tone: "error" });
754
752
  if (state.verdict === "ready") return h(Pill, { label: "正常", tone: "ready" });
@@ -763,7 +761,7 @@ window.__ModuleLoader__.load({
763
761
  /**
764
762
  * A numbered list of doctor findings.
765
763
  * @param props - heading, findings, whether they block, and the ids the
766
- * full check can repair.
764
+ * explicit repair can repair.
767
765
  * @returns the list, or null when there is nothing to show.
768
766
  */
769
767
  function IssueList({ heading, items, severity, repairable }) {
@@ -791,8 +789,8 @@ window.__ModuleLoader__.load({
791
789
  }
792
790
 
793
791
  /**
794
- * The full check's repair rows: what the doctor did, with its status mark.
795
- * @param props - the `fix.*` rows the full run answered with.
792
+ * The repair action's rows: what the doctor did, with its status mark.
793
+ * @param props - the `fix.*` rows the repair answered with.
796
794
  * @returns the list, or null when the run has no repair rows.
797
795
  */
798
796
  function RepairList({ items }) {
@@ -869,7 +867,7 @@ window.__ModuleLoader__.load({
869
867
  )),
870
868
  )),
871
869
  typeof state.notRun === "number" && state.notRun > 0
872
- ? h("div", { style: styles.hint }, `本次是快速检查,只覆盖首条命令的前置项;完整检查还会运行 ${String(state.notRun)} 项(agent 链路、工具、网络、配置等)。`)
870
+ ? h("div", { style: styles.hint }, `本次是快速检查,只覆盖首条命令的前置项;完整诊断还会运行 ${String(state.notRun)} 项(agent 链路、工具、网络、配置等)。`)
873
871
  : null,
874
872
  )
875
873
  : null,
@@ -920,8 +918,8 @@ window.__ModuleLoader__.load({
920
918
  { style: styles.summaryLine },
921
919
  h("span", { style: styles.summaryMuted }, state.verdict === "error" ? "尝试检查:" : "上次检查:"),
922
920
  h("span", null, typeof state.checkedAt === "number" ? checkedLabel(state.checkedAt) : "时间未知"),
923
- h("span", { style: styles.summaryMuted }, state.repaired === true
924
- ? (Array.isArray(state.repairs) && state.repairs.length > 0 ? "完整检查 · 已修复" : "完整检查")
921
+ h("span", { style: styles.summaryMuted }, state.full === true
922
+ ? (state.repaired === true ? "完整诊断 · 已修复" : "完整诊断")
925
923
  : "快速检查"),
926
924
  h("span", { style: styles.summaryMuted }, `来源:${state.source === "background" ? "后台" : "手动"}`),
927
925
  state.cached === true ? h("span", { style: styles.summaryMuted }, "缓存结果") : null,
@@ -1136,15 +1134,39 @@ window.__ModuleLoader__.load({
1136
1134
  };
1137
1135
 
1138
1136
  /**
1139
- * Run the full doctor with `--fix-owned`. The button is always
1140
- * **完整检查**: the run may repair plugin-owned state on the way, but the
1141
- * row does not relabel itself as a separate repair action. Only the
1142
- * plugin's own state is touched.
1137
+ * Run a full, read-only doctor report.
1143
1138
  * @param distro - the distro to run against.
1144
1139
  */
1145
1140
  const fullCheck = async (distro) => {
1146
1141
  setNotice(null);
1147
1142
  setChecks((previous) => ({ ...previous, [distro]: { ...previous[distro], phase: "fullChecking" } }));
1143
+ try {
1144
+ const answer = await statusRequest(`?distro=${encodeURIComponent(distro)}&full=1`);
1145
+ setChecks((previous) => ({ ...previous, [distro]: { phase: "done", ...answer } }));
1146
+ const repairable = Array.isArray(answer.repairable) ? answer.repairable.length : 0;
1147
+ const remaining = (Array.isArray(answer.failures) ? answer.failures.length : 0)
1148
+ + (Array.isArray(answer.warnings) ? answer.warnings.length : 0);
1149
+ setNotice({
1150
+ kind: remaining === 0 ? "ok" : "info",
1151
+ text: repairable > 0
1152
+ ? `完整诊断完成:发现 ${String(repairable)} 项插件状态可修复;点击“修复插件状态”可单独执行,其他 ${String(Math.max(0, remaining - repairable))} 项按处理办法手动处理。`
1153
+ : remaining > 0
1154
+ ? `完整诊断完成:发现 ${String(remaining)} 项需按下方处理办法处理;没有可自动修复的插件状态。`
1155
+ : `已在 ${distro} 完成完整诊断,未发现待处理项。`,
1156
+ });
1157
+ } catch (error) {
1158
+ setChecks((previous) => ({ ...previous, [distro]: { ...previous[distro], phase: "error", error: messageOf(error) } }));
1159
+ }
1160
+ };
1161
+
1162
+ /**
1163
+ * Run the explicit plugin-owned repair after a full report identifies
1164
+ * repairable findings.
1165
+ * @param distro - the distro to repair.
1166
+ */
1167
+ const repair = async (distro) => {
1168
+ setNotice(null);
1169
+ setChecks((previous) => ({ ...previous, [distro]: { ...previous[distro], phase: "repairing" } }));
1148
1170
  try {
1149
1171
  const answer = await statusRequest(`?distro=${encodeURIComponent(distro)}`, "POST");
1150
1172
  setChecks((previous) => ({ ...previous, [distro]: { phase: "done", ...answer } }));
@@ -1155,17 +1177,18 @@ window.__ModuleLoader__.load({
1155
1177
  setNotice({
1156
1178
  kind: fixed > 0 || remaining === 0 ? "ok" : "info",
1157
1179
  text: fixed > 0 && remaining > 0
1158
- ? `完整检查完成:已在 ${distro} 修复 ${String(fixed)} 项;仍有 ${String(remaining)} 项需按下方处理办法手动处理。`
1180
+ ? `插件状态修复完成:已在 ${distro} 修复 ${String(fixed)} 项;仍有 ${String(remaining)} 项需按下方处理办法手动处理。`
1159
1181
  : fixed > 0
1160
- ? `完整检查完成:已在 ${distro} 修复 ${String(fixed)} 项;复检通过。`
1182
+ ? `插件状态修复完成:已在 ${distro} 修复 ${String(fixed)} 项;复检通过。`
1161
1183
  : rows.length > 0
1162
- ? `完整检查完成:尝试修复 ${String(rows.length)} 项但未通过复检;请按下方处理办法手动处理。`
1184
+ ? `已尝试修复 ${String(rows.length)} 项,但复检未通过;请按下方处理办法继续处理。`
1163
1185
  : remaining > 0
1164
- ? `完整检查完成;没有可自动修复项,${String(remaining)} 项需按下方处理办法手动处理。`
1165
- : `已在 ${distro} 完成完整检查,未发现待修项。`,
1186
+ ? `未发现可自动修复的插件状态;${String(remaining)} 项需按下方处理办法手动处理。`
1187
+ : `已在 ${distro} 完成插件状态修复与复检。`,
1166
1188
  });
1167
1189
  } catch (error) {
1168
- setChecks((previous) => ({ ...previous, [distro]: { ...previous[distro], phase: "error", error: messageOf(error) } }));
1190
+ setChecks((previous) => ({ ...previous, [distro]: { ...previous[distro], phase: "done" } }));
1191
+ setNotice({ kind: "error", text: `插件状态修复失败:${messageOf(error)}` });
1169
1192
  }
1170
1193
  };
1171
1194
 
@@ -1253,7 +1276,7 @@ window.__ModuleLoader__.load({
1253
1276
  const busyAny = distros.some((distro) => {
1254
1277
  const state = checks[distro];
1255
1278
  return state !== undefined
1256
- && (state.phase === "checking" || state.phase === "fullChecking" || state.phase === "refreshing");
1279
+ && (state.phase === "checking" || state.phase === "fullChecking" || state.phase === "repairing" || state.phase === "refreshing");
1257
1280
  });
1258
1281
  const hasAnyResult = distros.some((distro) => checks[distro] !== undefined);
1259
1282
 
@@ -1273,7 +1296,7 @@ window.__ModuleLoader__.load({
1273
1296
  typeof plugin.installed === "string" ? h(Pill, { label: `v${plugin.installed}`, tone: "idle", title: "已安装的插件版本" }) : null,
1274
1297
  pluginAvailable ? h(Pill, { label: `可升级 ${latest.version}`, tone: "blocked", title: "发现新的插件版本" }) : null,
1275
1298
  ),
1276
- h("div", { style: styles.subtitle }, "诊断、版本与安全修复:已安装的发行版、快速检查、插件升级,以及插件自有状态的修复。"),
1299
+ h("div", { style: styles.subtitle }, "查看 WSL 发行版状态并管理插件版本。"),
1277
1300
  ),
1278
1301
  pluginAvailable ? h(
1279
1302
  "div",
@@ -1293,7 +1316,11 @@ window.__ModuleLoader__.load({
1293
1316
  })
1294
1317
  : null,
1295
1318
  ) : null,
1296
- notice === null ? null : h("div", { style: notice.kind === "ok" ? styles.noticeOk : notice.kind === "info" ? styles.noticeInfo : styles.notice }, notice.text),
1319
+ notice === null ? null : h("div", {
1320
+ role: notice.kind === "error" ? "alert" : "status",
1321
+ "aria-live": notice.kind === "error" ? "assertive" : "polite",
1322
+ style: notice.kind === "ok" ? styles.noticeOk : notice.kind === "info" ? styles.noticeInfo : styles.notice,
1323
+ }, notice.text),
1297
1324
  h(
1298
1325
  Card,
1299
1326
  {
@@ -1325,10 +1352,9 @@ window.__ModuleLoader__.load({
1325
1352
  : pluginAvailable && plugin.updateSupported !== true
1326
1353
  ? h("div", { style: styles.hint }, "当前宿主的插件管理器不支持一键升级;请在 Plugins 页升级。")
1327
1354
  : null,
1328
- h(
1329
- "div",
1330
- { style: styles.hint },
1331
- "版本检查委托给宿主的插件管理器(与 Plugins 页同源):读取 registry、弃用标记与 DSH/peer 兼容性。一键升级只在点击后执行,不会自动安装;完成后按提示刷新页面或重启 DSH。无法自动升级时,请在 Plugins 页手动安装新版本。",
1355
+ h("details", null,
1356
+ h("summary", { style: { ...styles.hint, cursor: "pointer" } }, "版本检查与升级说明"),
1357
+ h("div", { style: styles.hint }, "版本检查委托给宿主的插件管理器(与 Plugins 页同源):读取 registry、弃用标记与 DSH/peer 兼容性。一键升级只在点击后执行,不会自动安装;完成后按提示刷新页面或重启 DSH。无法自动升级时,请在 Plugins 页手动安装新版本。"),
1332
1358
  ),
1333
1359
  ),
1334
1360
  h(
@@ -1351,10 +1377,9 @@ window.__ModuleLoader__.load({
1351
1377
  }),
1352
1378
  ),
1353
1379
  },
1354
- h(
1355
- "div",
1356
- { style: styles.hint },
1357
- "“快速检查”运行一次 doctor 的快速检查(与 /wsl-doctor 同源):验证该发行版的 bwrap、systemd 与 Linger 等前置项。“完整检查”运行完整 doctor,并只修复插件自有状态(残留 session scope、损坏的 agent 缓存)后复检、显示 before→after。两个按钮都可在结果出现后再次点击,每次都重新执行。自动修复不安装软件包、不改写 Windows 配置;其余告警按各自处理办法手动处理。检查会让停止的发行版启动,所以只在点击时执行;页面加载的后台复核只针对正在运行的发行版,失败会按实际观测覆盖并标为“后台”来源。“清除”删除该发行版本机保存的检测结果,“清除全部”清空所有结果;两者都不探测、不修改发行版,但清除后需再次检查。",
1380
+ h("details", null,
1381
+ h("summary", { style: { ...styles.hint, cursor: "pointer" } }, "检查与修复说明"),
1382
+ h("div", { style: styles.hint }, "“快速检查”验证首条命令的前置项;“完整诊断”运行完整 doctor,二者均只读。完整诊断发现可修复的插件自有状态(残留 session scope、损坏的 agent 缓存)后,才显示独立的“修复插件状态”按钮;修复后复检并显示 before→after。修复不安装软件包、不改写 Windows 配置;其余告警按各自处理办法手动处理。检查会启动已停止的发行版,所以只在点击时执行;页面加载的后台复核只针对正在运行的发行版,失败会按实际观测覆盖并标为“后台”来源。“清除”删除该发行版本机保存的检测结果,“清除全部”清空所有结果;两者都不探测、不修改发行版,但清除后需再次检查。"),
1358
1383
  ),
1359
1384
  phase === "loading"
1360
1385
  ? h("div", { style: styles.empty }, "加载中…")
@@ -1368,17 +1393,18 @@ window.__ModuleLoader__.load({
1368
1393
  const checking = state !== undefined && state.phase === "checking";
1369
1394
  const fullChecking = state !== undefined && state.phase === "fullChecking";
1370
1395
  const refreshing = state !== undefined && state.phase === "refreshing";
1371
- const busy = checking || fullChecking || refreshing;
1396
+ const repairing = state !== undefined && state.phase === "repairing";
1397
+ const busy = checking || fullChecking || repairing || refreshing;
1372
1398
  const hasResult = state !== undefined && (state.phase === "done" || state.phase === "error");
1373
1399
  const repairable = Array.isArray(state?.repairable) ? state.repairable : [];
1374
- const canRepair = done && repairable.length > 0;
1400
+ const canRepair = done && state.full === true && repairable.length > 0;
1375
1401
  const findings = done
1376
1402
  ? (Array.isArray(state.failures) ? state.failures.length : 0)
1377
1403
  + (Array.isArray(state.warnings) ? state.warnings.length : 0)
1378
1404
  : 0;
1379
1405
  return h(
1380
1406
  "div",
1381
- { key: distro, style: styles.row },
1407
+ { key: distro, style: styles.row, "aria-busy": busy },
1382
1408
  h(
1383
1409
  "div",
1384
1410
  { style: styles.rowHead },
@@ -1392,11 +1418,19 @@ window.__ModuleLoader__.load({
1392
1418
  onClick: () => { void check(distro); },
1393
1419
  }),
1394
1420
  h(Btn, {
1395
- label: fullChecking ? "完整检查中…" : "完整检查",
1421
+ label: fullChecking ? "完整诊断中…" : "完整诊断",
1396
1422
  small: true,
1397
1423
  disabled: busy,
1398
1424
  onClick: () => { void fullCheck(distro); },
1399
1425
  }),
1426
+ canRepair
1427
+ ? h(Btn, {
1428
+ label: repairing ? "修复中…" : `修复插件状态(${String(repairable.length)})`,
1429
+ small: true,
1430
+ disabled: busy,
1431
+ onClick: () => { void repair(distro); },
1432
+ })
1433
+ : null,
1400
1434
  hasResult
1401
1435
  ? h(Btn, {
1402
1436
  label: "清除",
@@ -1407,13 +1441,15 @@ window.__ModuleLoader__.load({
1407
1441
  : null,
1408
1442
  ),
1409
1443
  state === undefined
1410
- ? h("div", { style: styles.hint }, "尚未检查:点击“快速检查”(约 10 秒)或“完整检查”;两者都会启动停止的发行版。")
1444
+ ? h("div", { style: styles.hint }, "尚未检查:选择快速检查或完整诊断。检查可能启动已停止的发行版。")
1411
1445
  : state.phase === "checking"
1412
- ? h("div", { style: styles.hint }, "正在运行快速检查…(会启动停止的发行版)")
1446
+ ? h("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", style: styles.hint }, "正在启动发行版(若已停止)并运行快速检查…")
1413
1447
  : state.phase === "fullChecking"
1414
- ? h("div", { style: styles.hint }, "正在运行完整检查,并修复插件自有状态(残留 session scope、损坏的 agent 缓存)…")
1448
+ ? h("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", style: styles.hint }, "正在启动发行版(若已停止)并运行只读的完整诊断…")
1449
+ : state.phase === "repairing"
1450
+ ? h("div", { role: "status", "aria-live": "polite", "aria-atomic": "true", style: styles.hint }, "正在启动发行版(若已停止),修复插件自有状态并复检…")
1415
1451
  : state.phase === "error"
1416
- ? h("div", { style: styles.detail }, h("span", { style: styles.failure }, state.error))
1452
+ ? h("div", { role: "alert", "aria-live": "assertive", style: styles.detail }, h("span", { style: styles.failure }, state.error))
1417
1453
  : h(
1418
1454
  "div",
1419
1455
  { style: styles.detail },
@@ -1426,17 +1462,17 @@ window.__ModuleLoader__.load({
1426
1462
  heading: `待修项(${String(Array.isArray(state.failures) ? state.failures.length : 0)})`,
1427
1463
  items: state.failures,
1428
1464
  severity: "fail",
1429
- repairable,
1465
+ repairable: canRepair ? repairable : [],
1430
1466
  }),
1431
1467
  h(IssueList, {
1432
1468
  heading: `告警(${String(Array.isArray(state.warnings) ? state.warnings.length : 0)})`,
1433
1469
  items: state.warnings,
1434
1470
  severity: "warn",
1435
- repairable,
1471
+ repairable: canRepair ? repairable : [],
1436
1472
  }),
1437
1473
  findings > 0
1438
1474
  ? h("div", { style: styles.hint }, canRepair
1439
- ? "标有“可自动修复”的项会由“完整检查”处理;其余项目需按处理办法手动处理。"
1475
+ ? "标有“可自动修复”的项可由“修复插件状态”处理;其余项目需按处理办法手动处理。"
1440
1476
  : "以上项目没有可自动修复项,需按各自处理办法手动处理。自动修复只覆盖残留 session scope 与损坏的 agent 缓存。")
1441
1477
  : null,
1442
1478
  h(CheckDetails, { state }),
package/docs/API.md CHANGED
@@ -24,7 +24,7 @@ this page is the quick tour.
24
24
  | `./file-reference-wsl` | `traversalArgv`, `parseTraversalListing`, `FileReferenceTraversal`, … | the distro-side traversal strategy for `@` completion (pure library — built and tested, not yet wired to a row; see ARCHITECTURE) |
25
25
  | `./wsl-doctor-tool` | the `wsl-doctor-tool` row | the `wsl_doctor` model tool: in-process diagnosis with scoping (`depth`, `section`) |
26
26
  | `./wsl-doctor-command` | the `wsl-doctor-command` row | the `/wsl-doctor` UI command: spawns the standalone doctor CLI, renders detached from model history |
27
- | `./status` | the `wsl-status` row | the sidebar panel's route over `/api`: installed distros, one distro's quick doctor, and the `--fix-owned` full check (which also repairs plugin-owned state); the last result persists across reloads and running distros' stored results refresh in the background; `DELETE` clears one stored result (`?distro=<name>`) or every result without enumerating or probing a distro |
27
+ | `./status` | the `wsl-status` row | the sidebar panel's route over `/api`: installed distros, one distro's quick doctor, `?distro=<name>&full=1` for full read-only diagnosis, and an explicit `POST` for `--fix-owned` plugin-state repair; the last result persists across reloads and running distros' stored results refresh in the background; `DELETE` clears one stored result (`?distro=<name>`) or every result without probing a distro |
28
28
  | `./plugin-update` | the `wsl-plugin-update` row | the panel's version and upgrade route over `/api`: installed/running plugin versions, the newest installable stable release and its compatibility, and the confirmed one-click `updateBundle` action |
29
29
  | `./paths` | `uncToPosix`, `toLinuxPath`, `toWorldPath`, … | the coordinate mappers |
30
30
  | `./picker` | `WslDirectoryPicker` | the distro-aware directory picker |
package/docs/API.zh.md CHANGED
@@ -23,7 +23,7 @@
23
23
  | `./file-reference-wsl` | `traversalArgv`、`parseTraversalListing`、`FileReferenceTraversal`、… | 用于 `@` 补全的发行版侧遍历策略(纯库——已构建并测试,尚未接入行;见 ARCHITECTURE) |
24
24
  | `./wsl-doctor-tool` | `wsl-doctor-tool` 行 | `wsl_doctor` 模型工具:带作用域(`depth`、`section`)的进程内诊断 |
25
25
  | `./wsl-doctor-command` | `wsl-doctor-command` 行 | `/wsl-doctor` UI 命令:启动独立 doctor CLI,渲染结果不进入模型历史 |
26
- | `./status` | `wsl-status` 行 | 侧栏面板经 `/api` 的路由:已安装发行版、单个发行版的快速 doctor,以及 `--fix-owned` 完整检查(同时修复插件自有状态);最近结果跨重载保留,运行中发行版的已存结果在后台刷新;`DELETE` 清除单个(`?distro=<名称>`)或全部已存结果,不枚举、不探测发行版 |
26
+ | `./status` | `wsl-status` 行 | 侧栏面板经 `/api` 的路由:已安装发行版、单个发行版的快速 doctor、`?distro=<名称>&full=1` 完整只读诊断,以及显式 `POST` 的 `--fix-owned` 插件状态修复;最近结果跨重载保留,运行中发行版的已存结果在后台刷新;`DELETE` 清除单个(`?distro=<名称>`)或全部已存结果,不探测发行版 |
27
27
  | `./plugin-update` | `wsl-plugin-update` 行 | 面板经 `/api` 的版本与升级路由:已安装/运行中的插件版本、最新的可安装稳定版及其兼容性,以及点击确认后的一键 `updateBundle` |
28
28
  | `./paths` | `uncToPosix`、`toLinuxPath`、`toWorldPath`、… | 坐标映射器 |
29
29
  | `./picker` | `WslDirectoryPicker` | 能感知发行版的目录选择器 |
@@ -81,7 +81,7 @@ functions.
81
81
  | `dsh-plugin-wsl-env/cwd-prompt-tool` | `wsl-cwd-prompt-tool` | [`lib/cwd-prompt-tool.js`](../lib/cwd-prompt-tool.js) | Serves the model's read/`cd` tool with the same semantics the harness ships, rewriting the returned `cwd` to the distro's POSIX form. |
82
82
  | `dsh-plugin-wsl-env/wsl-doctor-tool` | `wsl-doctor-tool` | [`lib/wsl-doctor-tool.js`](../lib/wsl-doctor-tool.js) | The `wsl_doctor` model tool: the doctor in-process (merging the live resident's state), scoped by `depth`/`section`, rendered as the itemized digest. |
83
83
  | `dsh-plugin-wsl-env/wsl-doctor-command` | `wsl-doctor-command` | [`lib/wsl-doctor-command.js`](../lib/wsl-doctor-command.js) | The `/wsl-doctor` UI command: spawns the standalone doctor CLI as a host subprocess and renders the same digest detached from model history. |
84
- | `dsh-plugin-wsl-env/status` | `wsl-status` | [`lib/status.js`](../lib/status.js) | The sidebar panel's route (`GET /api/wsl-env/status`): lists the installed distros and runs one distro's quick doctor; `POST` on the same route runs the full doctor with `--fix-owned` (which also repairs stale scopes or a broken agent cache and re-verifies both). `DELETE` on the same route clears one stored result (`?distro=<name>`) or every stored result, without listing or probing a distro. Answered over the Host connection's authenticated exact-Fetch channel; the last result per distro is persisted under `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json` and stored results for running distros are refreshed in the background. |
84
+ | `dsh-plugin-wsl-env/status` | `wsl-status` | [`lib/status.js`](../lib/status.js) | The sidebar panel's route (`GET /api/wsl-env/status`): lists installed distros and runs one distro's quick doctor; `GET ?distro=<name>&full=1` runs a full read-only diagnosis; an explicit `POST` runs `--fix-owned` to repair plugin-owned state and re-verify it. `DELETE` clears one stored result (`?distro=<name>`) or every result, without probing a distro. Answered over the Host connection's authenticated exact-Fetch channel; the last result per distro is persisted under `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json` and stored results for running distros are refreshed in the background. |
85
85
  | `dsh-plugin-wsl-env` (bare name) | `wsl-env-client-host` | [`lib/client-host.js`](../lib/client-host.js) | The deliberate no-op host half whose bare-name mount lets the web client roster serve `./client`: the sidebar's WSL environment panel and the post-add access-mode prompt. |
86
86
 
87
87
  Three path and interop helpers import no DSH package.
@@ -600,8 +600,9 @@ standalone CLI (peer-free by design, so it starts when the plugin's own
600
600
  runtime is broken), the `/wsl-doctor` UI command (spawns the CLI host-side,
601
601
  renders detached from model history), and the `wsl_doctor` model tool
602
602
  (in-process, merging the live resident's state through `lib/doctor-live.js`).
603
- The sidebar panel renders the quick digest and posts the full-check action the
604
- same way (`--fix-owned`: plugin-owned state only). A run can be scoped (`--quick`, `--sections <csv>` on the CLI; `depth` /
603
+ The sidebar panel renders the quick digest and a full read-only diagnosis;
604
+ repairable plugin-owned findings are repaired only after the user separately
605
+ starts `--fix-owned`. A run can be scoped (`--quick`, `--sections <csv>` on the CLI; `depth` /
605
606
  `section` on the tool), and the report itemizes every check grouped by
606
607
  distro. See [DIAGNOSTICS.md](DIAGNOSTICS.md) for the surfaces and the
607
608
  verdict contract.
@@ -72,7 +72,7 @@ GUI 文件树与预览保留随包的 `workspace-files` 行。它的客户端半
72
72
  | `dsh-plugin-wsl-env/cwd-prompt-tool` | `wsl-cwd-prompt-tool` | [`lib/cwd-prompt-tool.js`](../lib/cwd-prompt-tool.js) | 以 harness 随包提供的相同语义提供模型的 read/`cd` 工具,把返回的 `cwd` 改写为发行版的 POSIX 形式。 |
73
73
  | `dsh-plugin-wsl-env/wsl-doctor-tool` | `wsl-doctor-tool` | [`lib/wsl-doctor-tool.js`](../lib/wsl-doctor-tool.js) | `wsl_doctor` 模型工具:进程内的 doctor(合并活跃常驻 agent 的状态),按 `depth`/`section` 限定范围,渲染为逐项摘要。 |
74
74
  | `dsh-plugin-wsl-env/wsl-doctor-command` | `wsl-doctor-command` | [`lib/wsl-doctor-command.js`](../lib/wsl-doctor-command.js) | `/wsl-doctor` UI 命令:把独立的 doctor CLI 作为宿主子进程启动,并在与模型历史分离的界面中渲染同一份摘要。 |
75
- | `dsh-plugin-wsl-env/status` | `wsl-status` | [`lib/status.js`](../lib/status.js) | 侧边栏面板的路由(`GET /api/wsl-env/status`):列出已安装的发行版,并对其中一个发行版运行 quick doctor;同一路由上的 `POST` 运行 `--fix-owned` 完整检查(同时修复陈旧的 scope 或损坏的 agent 缓存并重新验证);同一路由上的 `DELETE` 清除单个(`?distro=<名称>`)或全部已存结果,不枚举、不探测发行版。响应经 Host 连接已认证的 exact-Fetch 通道返回;每个发行版的最近结果持久化在 `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`,运行中发行版的已存结果会在后台刷新。 |
75
+ | `dsh-plugin-wsl-env/status` | `wsl-status` | [`lib/status.js`](../lib/status.js) | 侧边栏面板的路由(`GET /api/wsl-env/status`):列出已安装的发行版,对单个发行版运行 quick doctor;`GET ?distro=<名称>&full=1` 运行完整只读诊断;显式 `POST` 以 `--fix-owned` 修复插件自有状态并重新验证;`DELETE` 清除单个(`?distro=<名称>`)或全部已存结果,不探测发行版。响应经 Host 连接已认证的 exact-Fetch 通道返回;每个发行版的最近结果持久化在 `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`,运行中发行版的已存结果会在后台刷新。 |
76
76
  | `dsh-plugin-wsl-env`(裸名) | `wsl-env-client-host` | [`lib/client-host.js`](../lib/client-host.js) | 有意为之的空操作宿主半边;它的裸名挂载让 web 客户端名册能够提供 `./client`:侧边栏的 WSL 环境面板,以及添加后的访问模式提示。 |
77
77
 
78
78
  三个路径与 interop 助手不导入任何 DSH 包。
@@ -537,7 +537,7 @@ peer 下限、新 agent 握手和陈旧的会话 scope,并报告带版本的 `
537
537
  同一份报告通过三个界面应答:这个独立 CLI(设计上无 peer 依赖,因此插件自身
538
538
  运行时损坏时它仍能启动)、`/wsl-doctor` UI 命令(在宿主侧启动 CLI,渲染与
539
539
  模型历史分离),以及 `wsl_doctor` 模型工具(进程内,通过 `lib/doctor-live.js`
540
- 合并活跃常驻 agent 的状态)。侧边栏面板以同样方式渲染快速摘要并提交完整检查动作
541
- (`--fix-owned`:仅插件自有状态)。运行可以限定范围(CLI 上的 `--quick`、
540
+ 合并活跃常驻 agent 的状态)。侧边栏面板渲染快速摘要与完整只读诊断;发现可修复项后
541
+ 由用户单独提交插件状态修复(`--fix-owned`)。运行可以限定范围(CLI 上的 `--quick`、
542
542
  `--sections <csv>`;工具上的 `depth` / `section`),报告按发行版分组逐项列出
543
543
  每项检查。各界面与判定契约见 [DIAGNOSTICS.zh.md](DIAGNOSTICS.zh.md)。
@@ -520,8 +520,9 @@ error-code map. Whether a row override applied, read from the profile's
520
520
  `cordis.patch.yml` and the Plugins page: the desktop app has no `dsh` command,
521
521
  so the composed profile has no command-line view.
522
522
  The sidebar's **WSL environment** panel renders the same quick digest over
523
- `GET /api/wsl-env/status` and posts the full-check action to the same route: a
524
- doctor run with `--fix-owned`, which sweeps stale session scopes and purges a
523
+ `GET /api/wsl-env/status`; `?distro=<name>&full=1` runs a full read-only
524
+ diagnosis. When it finds repairable plugin-owned state, a separate `POST` to
525
+ the same route runs `--fix-owned`, sweeping stale session scopes or purging a
525
526
  broken agent cache, then re-verifies both. Each row states when the check ran, its source (manual or background) and its
526
527
  result structure (per-status totals and per-section tallies). The last result
527
528
  per distro is stored at `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`
@@ -532,12 +533,12 @@ the stored result. Nothing is labeled expired — each checked row offers
532
533
  **清除** and the card offers **清除全部**; both `DELETE` the same route
533
534
  (optionally with `?distro=`) to drop the stored verdict without enumerating,
534
535
  probing or modifying a distro. Deleting the file still resets the panel's
535
- history equivalently. Every row offers **快速检查** and **完整检查**: the
536
- latter is the full doctor with `--fix-owned`, which repairs plugin-owned state
537
- (stale session scopes or a broken agent cache) and re-verifies it. Both keep
538
- their names after a result and run again on every click; every other warning
539
- keeps its manual remedy. It never installs packages or rewrites Windows-owned
540
- or user configuration.
536
+ history equivalently. Every row offers **快速检查** and **完整诊断**: both are
537
+ read-only. When the full report finds repairable plugin-owned state (stale
538
+ session scopes or a broken agent cache), a separate **修复插件状态** action
539
+ runs `--fix-owned` and re-verifies it. Check actions remain available after a
540
+ result; every other warning keeps its manual remedy. Repair never installs
541
+ packages or rewrites Windows-owned or user configuration.
541
542
  Above the distro rows, the **Plugin version** card reads the installed and
542
543
  running plugin versions and the newest installable stable release; its
543
544
  **一键升级** button posts to `/api/wsl-env/plugin-update`, and only that click
@@ -468,17 +468,18 @@ profile 补丁与废弃键陷阱——每个失败附可复制的修复。运行
468
468
  判定契约与错误码地图见 [DIAGNOSTICS.zh.md](DIAGNOSTICS.zh.md)。
469
469
  某行的覆盖是否生效,直接查看 profile 的 `cordis.patch.yml` 与 Plugins 页面:
470
470
  桌面应用没有 `dsh` 命令,合成后的 profile 没有命令行视图。
471
- 侧边栏的 **WSL 环境** 面板经 `GET /api/wsl-env/status` 渲染同一份快速摘要,
472
- 并把“完整检查”动作提交到同一路由:以 `--fix-owned` 运行 doctor,清扫残留
473
- session scope、清理损坏的 agent 缓存并逐一复检。行内显示上次检查时间、来源(手动或后台)与结果结构(各状态计数与分区分布)。
471
+ 侧边栏的 **WSL 环境** 面板经 `GET /api/wsl-env/status` 渲染同一份快速摘要;
472
+ `?distro=<名称>&full=1` 运行完整只读诊断,发现插件自有状态可修复时,才显示独立的
473
+ 修复动作。该动作以 `POST` 提交同一路由,使用 `--fix-owned` 清扫残留 session scope、
474
+ 清理损坏的 agent 缓存并逐一复检。行内显示上次检查时间、来源(手动或后台)与结果结构(各状态计数与分区分布)。
474
475
  每个发行版的最后一次结果存放在 `$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`
475
476
  (宿主未指定 home 时为 `~/.dsh/...`),页面刷新或应用重启后仍可见。加载时会对
476
477
  正在运行的发行版在后台复核;后台失败会覆盖已存结果。不标记“已过期”——每个
477
478
  已检查行提供“清除”、卡片头部提供“清除全部”,经同一路由的 `DELETE`(可带
478
479
  `?distro=`)删除本地保存的结果,不枚举、不探测也不修改发行版;直接删除该文件
479
- 仍可等效重置面板历史。每行固定提供“快速检查”和“完整检查”两个检查动作:后者
480
- 以 `--fix-owned` 运行完整 doctor,会修复插件自有状态(残留 session scope、
481
- 损坏的 agent 缓存)并复检;两个按钮在结果出现后仍保持原名,再次点击即再次执行。
480
+ 仍可等效重置面板历史。每行提供“快速检查”和“完整诊断”两个只读检查动作;完整
481
+ 诊断发现可修复项后,单独显示“修复插件状态”,并在修复后复检。检查按钮在结果出现
482
+ 后仍可再次点击。修复只处理插件自有状态(残留 session scope、损坏的 agent 缓存);
482
483
  其余告警保留各自的手动处理办法。它不会安装软件包,也不会改写 Windows 或用户所有的配置。
483
484
  在发行版行上方,「插件版本」卡片读取已安装与运行中的插件版本及最新的可安装稳定版;
484
485
  它的「一键升级」提交到 `/api/wsl-env/plugin-update`,只有这次点击会调用宿主插件
@@ -45,9 +45,9 @@ of what it claims to have fixed, the affected checks carry the after state,
45
45
  and the verdict is recomputed — `ready`, or the remaining blockers. The
46
46
  plugin-owned state is repaired automatically: the stale-scope sweep and a
47
47
  purge of the agent cache when an entry is not executable (the handshake is
48
- re-probed after the purge). `--fix-owned` narrows a run to exactly those two —
49
- the sidebar panel's full-check action uses it — and cannot be combined with
50
- `--install`. Remedies that rewrite user- or distro-owned files (`.wslconfig`,
48
+ re-probed after the purge). `--fix-owned` narrows a repair to exactly those two
49
+ and cannot be combined with `--install`. Remedies that rewrite user- or
50
+ distro-owned files (`.wslconfig`,
51
51
  `/etc/wsl.conf`, a WSL1 conversion, installing a distro) are never automated;
52
52
  the remedy text says so.
53
53
 
@@ -59,9 +59,10 @@ environment variables, and no telemetry.
59
59
  ## The surfaces
60
60
 
61
61
  The doctor answers through three surfaces with one report; the sidebar's
62
- **WSL environment** panel renders the same quick digest over its own route and
63
- posts the full-check action (`--fix-owned`, which also repairs plugin-owned
64
- state). The same panel's **Plugin version** card is separate from the doctor: it reads the
62
+ **WSL environment** panel renders the quick digest and a full read-only report
63
+ over its own route. Only after a full report identifies repairable plugin-owned
64
+ state can the user separately trigger `--fix-owned`. The same panel's **Plugin
65
+ version** card is separate from the doctor: it reads the
65
66
  installed/running plugin versions and offers the one-click upgrade through the
66
67
  host plugin manager ([CONFIGURATION](CONFIGURATION.md), `wsl-plugin-update`).
67
68
 
@@ -80,12 +81,12 @@ host plugin manager ([CONFIGURATION](CONFIGURATION.md), `wsl-plugin-update`).
80
81
  the itemized report renders detached from model history (no model turn, no
81
82
  tokens). The sidebar's **WSL environment** panel runs the same quick
82
83
  check per distro through the authenticated status route, showing a badge with
83
- numbered failing items and warnings. Every row offers two fixed check
84
- actions: **快速检查** (the quick doctor scope) and **完整检查** (the full
85
- doctor with `--fix-owned`, which also repairs plugin-owned state — stale
86
- scopes or a broken agent cache — and answers with its before → after fix
87
- rows). Both keep their names after a result and run again on every click;
88
- there is no separate "recheck" action. The row also states when the check ran, its source
84
+ numbered failing items and warnings. Every row offers **快速检查** (the quick
85
+ doctor scope) and **完整诊断** (the full doctor, read-only). When that report
86
+ finds repairable plugin-owned state — stale scopes or a broken agent cache —
87
+ the row separately offers **修复插件状态**. It uses `--fix-owned` and
88
+ answers with before → after repair rows; it never installs packages or
89
+ rewrites user configuration. Actions can be run again after a result. The row also states when the check ran, its source
89
90
  (manual or the page-load background refresh), and how its results landed —
90
91
  per-status totals and per-section tallies. Each checked row expands to the
91
92
  full list of checks that run executed, grouped by section with each status
@@ -96,8 +97,7 @@ host plugin manager ([CONFIGURATION](CONFIGURATION.md), `wsl-plugin-update`).
96
97
  are already up, and a failed one replaces the stored result as observed.
97
98
  Each checked row offers **清除** and the card offers **清除全部**; both
98
99
  `DELETE` the same route, dropping the local store without starting a doctor
99
- run or enumerating a distro. Manual warnings keep their remedies; full
100
- diagnosis still uses the entry above and `/wsl-doctor`. Without a command adapter (headless, ACP) the row is a no-op and
100
+ run or enumerating a distro. Manual warnings keep their remedies. Without a command adapter (headless, ACP) the row is a no-op and
101
101
  the CLI is the surface. Without `--distro` the handler names the distro from
102
102
  the session's live working directory (the agent-scoped `workingDirectory`
103
103
  service first, then the Session header's `cwd`); when neither yields a WSL
@@ -37,9 +37,8 @@
37
37
 
38
38
  `--fix` 以复验报告收尾:每个修复后都跟着一次对它声称修好的东西的全新探查,
39
39
  受影响的检查项携带 after 状态,verdict 重算——`ready`,或剩余阻断者。
40
- 插件自有状态会被自动修复:残留 scope 清扫,以及缓存条目不可执行时清理
41
- agent 缓存(清理后重新握手)。`--fix-owned` 把运行收窄到这两类——侧边栏
42
- 面板的“完整检查”动作即用它——且不能与 `--install` 同用。会改写用户或 distro
40
+ 插件自有状态可自动修复:残留 scope 清扫,以及缓存条目不可执行时清理
41
+ agent 缓存(清理后重新握手)。`--fix-owned` 把修复收窄到这两类,且不能与 `--install` 同用。会改写用户或 distro
43
42
  所有文件的修复(`.wslconfig`、`/etc/wsl.conf`、WSL1 转换、安装 distro)
44
43
  永不开启自动化;补救文本会写明。
45
44
 
@@ -50,7 +49,8 @@ bundle 不含文件内容、环境变量,也没有遥测。
50
49
  ## 三个入口
51
50
 
52
51
  doctor 通过三个入口给出同一份报告;侧边栏的 **WSL 环境** 面板经自己的
53
- 路由渲染同一份快速摘要,并提交“完整检查”动作(`--fix-owned`)。
52
+ 路由渲染快速摘要与完整只读诊断;只有完整诊断列出可修复项后,用户才可单独
53
+ 触发 `--fix-owned` 插件状态修复。
54
54
  同一面板的「插件版本」卡片独立于 doctor:它读取已安装/运行中的插件版本,并提供
55
55
  经宿主插件管理器执行的一键升级(见 [CONFIGURATION.zh.md](CONFIGURATION.zh.md) 的 `wsl-plugin-update`)。
56
56
 
@@ -67,17 +67,18 @@ doctor 通过三个入口给出同一份报告;侧边栏的 **WSL 环境** 面
67
67
  `/wsl-doctor [quick|full|<分区>] [--distro <名称>]`;命令面在宿主侧执行,
68
68
  handler 子进程运行独立 CLI,逐项报告直接渲染在 UI 上、不进模型历史
69
69
  (无模型回合、零 token)。侧边栏的 **WSL 环境** 面板按发行版运行同源的快速检查,
70
- 结果以状态徽标、编号的待修项与告警列出。每行固定提供两个检查动作:**快速检查**
71
- (doctor 的 quick 范围)与 **完整检查**(完整 doctor,`--fix-owned`,会修复插件
72
- 自有状态——残留 scope 或损坏的 agent 缓存——并返回 before → after 的修复行)。
73
- 两个按钮在结果出现后仍保持原名,再次点击即再次执行,不存在单独的“重新检查”动作。
70
+ 结果以状态徽标、编号的待修项与告警列出。每行提供 **快速检查**(doctor 的 quick 范围)
71
+ 与 **完整诊断**(完整 doctor,只读)两个检查动作;完整诊断发现可修复的插件自有状态
72
+ (残留 scope 或损坏的 agent 缓存)后,才显示独立的 **修复插件状态** 动作。
73
+ 修复以 `--fix-owned` 执行并返回 before → after 结果;不会安装软件包或改写用户配置。
74
+ 各动作在结果出现后仍可再次点击。
74
75
  行内同时给出上次检查时间、来源(手动或页面加载时的后台复核)与结果结构(各状态
75
76
  计数与分区分布)。每个已检查的行可展开查看本次运行执行的全部检查项,按分区分组、逐项带状态与依据;
76
- 快速检查未触及的目录项只以“完整检查还会运行 N 项”计数,不伪装成结果。最后一次结果存放在本地(`$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`,
77
+ 快速检查未触及的目录项只以“完整诊断还会运行 N 项”计数,不伪装成结果。最后一次结果存放在本地(`$DSH_HOME/cache/dsh-plugin-wsl-env/status.json`,
77
78
  缺省回退到 `~/.dsh`),刷新后仍可见;后台复核只针对正在运行的发行版,失败时按
78
79
  实际观测覆盖已存结果。每个已检查行可“清除”该发行版的结果,卡片头部可“清除全部”;
79
80
  两者经同一路由的 `DELETE` 完成,只删本地存档,不启动 doctor、不枚举发行版。
80
- 手动告警保留各自处理办法;
81
+ 手动告警保留各自处理办法;完整诊断与修复是两个独立动作。
81
82
  完整诊断仍走上面的入口与 `/wsl-doctor`。没有命令适配器的部署(headless、ACP)中该行是
82
83
  no-op,CLI 就是入口。未给 `--distro` 时,handler 从会话当前工作目录解析
83
84
  发行版(先读 agent 作用域的 `workingDirectory` 服务,再退回 Session 头部
@@ -204,10 +204,11 @@ remedy-only — the remedy text carries the exact command — and the fixable se
204
204
  is limited to what is safe and reversible (stale scopes, the plugin-owned
205
205
  agent cache, the optional packages behind `--install` plus a confirmation, and
206
206
  the Windows git safe.directory whitelist behind the same gate). `--fix-owned`
207
- narrows a run to the plugin-owned two (stale scopes and the cache); the
208
- sidebar panel's full-check action is exactly that run, so it can never install
209
- a package or write Windows-owned configuration, and it never implies that a
210
- remedy-only warning is auto-fixable. The verdict never upgrades the
207
+ narrows a repair to the plugin-owned two (stale scopes and the cache); the
208
+ sidebar's **修复插件状态** action is exactly that run, while full diagnosis
209
+ itself is read-only. It can never install a package or write Windows-owned
210
+ configuration, and it never implies that a remedy-only warning is auto-fixable.
211
+ The verdict never upgrades the
211
212
  sandbox's security statement: `enforcement: partial` is untouched.
212
213
 
213
214
  ## Session-start advisories
@@ -180,8 +180,8 @@ doctor 的 `verdict` 在生效配置(应用加载的 profile 层叠加在随
180
180
  携带确切的命令;可自动修复的集合仅限安全且可逆的部分(过期 scope、插件自有的
181
181
  agent 缓存、`--install` 加确认后的可选软件包、以及同一道确认门后的
182
182
  Windows git `safe.directory` 白名单)。`--fix-owned` 把运行收窄到插件自有
183
- 的两类(过期 scope 与缓存);侧边栏面板的“完整检查”动作正是这次运行,因此它
184
- 永远不会安装软件包或改写 Windows 所有的配置,也不会暗示仅能手动处理的告警
183
+ 的两类(过期 scope 与缓存);侧边栏面板的“修复插件状态”动作正是这次运行,
184
+ 完整诊断本身只读。因此它永远不会安装软件包或改写 Windows 所有的配置,也不会暗示仅能手动处理的告警
185
185
  可被自动修复。裁决从不升级沙箱的安全声明:
186
186
  `enforcement: partial` 不受影响。
187
187
 
@@ -34,9 +34,9 @@ supplies the WSL environment.
34
34
  No terminal at hand? Several ways without one: the sidebar's **WSL
35
35
  environment** panel runs a quick doctor check per distro, listing the badge,
36
36
  numbered failing items and warnings. Every row offers **快速检查** and
37
- **完整检查**; the latter is the full doctor with `--fix-owned`, which also
38
- repairs plugin-owned state (stale scopes and a broken agent cache) when
39
- present. Both run again on every click; typing `/wsl-doctor [quick|full|<section>]`
37
+ **完整诊断**; both are read-only. When the full report finds repairable
38
+ plugin-owned state, a separate **修复插件状态** action appears and re-verifies
39
+ the result. Typing `/wsl-doctor [quick|full|<section>]`
40
40
  in the composer also runs host-side and renders in the UI — no model turn, no
41
41
  tokens; in a session, ask for a diagnosis and the model runs the `wsl_doctor`
42
42
  tool (mounted by this plugin), the verdict landing in the transcript; and the
@@ -53,8 +53,8 @@ from `wsl.exe -l -v` itself, so no separate version check is needed. Doctor is
53
53
  read-only unless you pass `--fix`
54
54
  (the stale-scope sweep and a broken agent cache, both re-verified; the Windows
55
55
  git trust after a confirmation) or `--fix --install` (packages, after a
56
- confirmation); `--fix-owned` restricts a fix run to the plugin-owned state
57
- (the panel's full-check action); `--bundle <path>` writes
56
+ confirmation); `--fix-owned` restricts a fix run to plugin-owned state
57
+ (the panel's separate repair action); `--bundle <path>` writes
58
58
  the diagnostic file a setup report attaches (`--redact` strips the paths
59
59
  from it). A run can be scoped — `--quick` probes the first-command
60
60
  prerequisites plus one combined optional-tool probe (~10 s), `--sections
@@ -96,11 +96,12 @@ or an UNC path directly. The session's commands, file tools, terminal and previe
96
96
  all run in that distro; a Windows folder keeps the normal Windows environment.
97
97
 
98
98
  The sidebar's **WSL environment** panel is the diagnostic page: it lists the
99
- installed distros, runs one distro's quick doctor check on demand (showing
100
- whether bwrap, systemd and Linger are in place), and offers **快速检查** and
101
- **完整检查** on every row; the latter is the full doctor with `--fix-owned`,
102
- which also repairs plugin-owned state (a stale session scope or a broken agent
103
- cache). Both keep their names after a result and run again on every click; the
99
+ installed distros, runs one distro's quick or full read-only doctor check on
100
+ demand (showing whether bwrap, systemd and Linger are in place), and offers
101
+ **快速检查** and **完整诊断** on every row. If the full report finds repairable
102
+ plugin-owned state (a stale session scope or a broken agent cache), a separate
103
+ **修复插件状态** action runs `--fix-owned` and re-verifies the result. Check
104
+ actions remain available after a result; the
104
105
  row also shows when the check ran, its source (manual, or the page-load
105
106
  background refresh), and its result structure (pass/warn/fail/info/skip, plus
106
107
  the per-section tallies). Its **Plugin version** card reads the
@@ -108,11 +109,10 @@ installed/running versions and offers the one-click upgrade described above.
108
109
  The last result survives a page reload from the local store, and a stored
109
110
  result for a running distro is re-checked in the background on load. Each
110
111
  checked row offers **清除** and the card **清除全部** to drop local results
111
- without probing or modifying a distro. The run
112
- sweeps the scopes and purges the cache when they need it, then re-verifies;
113
- every other warning keeps its manual remedy, and the action never installs
112
+ without probing or modifying a distro. The explicit repair sweeps the scopes and purges the cache when they need it,
113
+ then re-verifies; every other warning keeps its manual remedy, and the action never installs
114
114
  packages or rewrites Windows-owned configuration (a check boots a stopped
115
- distro, so either action only runs on a click). Workspaces still open through
115
+ distro, so checks and repairs only run on a click). Workspaces still open through
116
116
  **Add workspace**; selecting a folder inside a
117
117
  distro through the picker makes the app ask once how to open it: **Remote
118
118
  WSL** (the default — commands, files and the terminal all run in the distro) or
@@ -124,6 +124,12 @@ running a non-WSL preset keeps a warning above the composer, with a one-click sw
124
124
  while the session is still blank and the access-record fix once a turn has started.
125
125
  Two distros can be open at once, each with its own environment.
126
126
 
127
+ The panel keeps its initial guidance brief and puts detailed version and
128
+ check/repair explanations in collapsed disclosures. While an action is running,
129
+ it names the current operation and notes that a stopped distro may start; it
130
+ does not invent a percentage or time estimate. Buttons and disclosures work
131
+ with the keyboard, and status and error updates expose screen-reader semantics.
132
+
127
133
  ### Open the workspace in VS Code (Remote-WSL)
128
134
 
129
135
  Opening the WSL folder as a Windows UNC share works but is the degraded mode:
@@ -30,9 +30,9 @@ dsh headless "run the tests" # 单任务、输出答案后退出
30
30
  | Node `^22.19.0` 或 `>=24.0.0` | 仅源码/开发工作需要 | 使用已发布的插件时,发行版内不需要 Node |
31
31
 
32
32
  手边没有终端?有几条不依赖终端的路:侧边栏的 **WSL 环境** 面板按发行版运行
33
- doctor 快速检查,结果以状态徽标、编号的待修项与告警列出;每行固定提供 **快速检查**
34
- 与 **完整检查**,后者以 `--fix-owned` 运行完整 doctor,并修复插件自有状态
35
- (残留 scope、损坏的 agent 缓存);两个按钮再次点击即再次执行;在输入框里输入
33
+ doctor 快速检查,结果以状态徽标、编号的待修项与告警列出;每行提供 **快速检查**
34
+ 与只读的 **完整诊断**;完整诊断发现可修复的插件自有状态后,才显示独立的
35
+ **修复插件状态**(残留 scope、损坏的 agent 缓存),并在修复后复检;在输入框里输入
36
36
  `/wsl-doctor [quick|full|<分区>]` 同样在宿主侧执行、直接渲染在 UI,不进模型
37
37
  对话、零 token;在会话里请求诊断,模型会运行本插件挂载的 `wsl_doctor` 工具,
38
38
  判定落在对话里;会话启动预检在每次会话打开时把同样的判定写进日志,只有 blocked
@@ -45,7 +45,7 @@ doctor(`scripts/doctor.mjs`,或在检出目录中运行 `pnpm run doctor`)
45
45
  读取,无需单独确认。doctor 默认只读,除非传入 `--fix`(清理过期 scope、清理损坏的
46
46
  agent 缓存,两者都会复检;以及确认后的 Windows git 信任)或
47
47
  `--fix --install`(安装软件包,需确认);`--fix-owned` 把修复限定在
48
- 插件自有状态(面板的“完整检查”动作);
48
+ 插件自有状态(面板的“修复插件状态”动作);
49
49
  `--bundle <路径>` 写出可附加到问题报告的诊断文件(`--redact`
50
50
  将其中的路径脱敏)。运行可以收窄范围——`--quick` 只探首条命令的前置项
51
51
  与一次合并的可选工具探测(约 10 秒),`--sections <分区清单>`(逗号分隔)
@@ -84,18 +84,20 @@ agent 缓存,两者都会复检;以及确认后的 Windows git 信任)或
84
84
  侧边栏的 **WSL 环境** 面板是诊断页:它列出已安装的发行版,可对单个发行版运行
85
85
  一次 doctor 快速检查,显示 bwrap、systemd、Linger 等前置项是否正常;顶部的
86
86
  「插件版本」卡片显示已安装与运行中的版本,并提供上文的一键升级;每行固定提供
87
- “快速检查”和“完整检查”两个按钮,后者运行完整 doctor(`--fix-owned`),会修复
88
- 插件自有状态(残留 session scope 或损坏的 agent 缓存);两个按钮在结果出现后
89
- 仍保持原名,再次点击即再次执行;行内还显示上次
87
+ “快速检查”和“完整诊断”两个只读检查按钮;完整诊断发现可修复的插件自有状态
88
+ (残留 session scope 或损坏的 agent 缓存)后,才显示独立的“修复插件状态”按钮,
89
+ 修复后会复检;检查按钮在结果出现后仍可再次点击;行内还显示上次
90
90
  检查时间、来源(手动,或页面加载时的后台复核)与结果结构(通过/告警/失败/
91
91
  信息/跳过,以及分区分布);最后一次结果会从本地存档恢复,正在运行的发行版会在
92
92
  页面加载时后台复核;已检查行可“清除”该发行版的结果,卡片头部可“清除全部”;
93
- 清除只删除本地存档,不探测、不修改发行版;运行时按需清扫
94
- 残留 scope、清理缓存并逐一复检,其余告警保留各自的手动处理办法,不安装软件包、
95
- 不改写 Windows 配置(检查会让停止的发行版启动,所以两种动作都只在点击时执行)。工作区仍在 **添加工作区** 里打开;选中发行版内的文件夹时,应用会问一次打开方式:**Remote WSL**(默认,命令、
93
+ 清除只删除本地存档,不探测、不修改发行版;显式修复只清扫残留 scope、清理缓存并逐一复检,其余告警保留各自的手动处理办法,不安装软件包、
94
+ 不改写 Windows 配置(检查会让停止的发行版启动,所以诊断和修复都只在点击时执行)。工作区仍在 **添加工作区** 里打开;选中发行版内的文件夹时,应用会问一次打开方式:**Remote WSL**(默认,命令、
96
95
  文件与终端都在发行版内)或 **Windows 访问**(把该文件夹当作普通 Windows 共享,经 9p
97
96
  读写,没有 Linux 工具链)。选择记录在 `auto-preset` 行的 `windowsWorkspaces` 里,
98
97
  对该工作区之后新建的会话同样生效。
98
+
99
+ 面板首屏只保留简短说明,版本与检查/修复的详细行为可通过折叠说明查看。检查和修复期间会显示当前动作,并提示可能启动已停止的发行版;不会显示虚构的百分比或耗时。按钮和说明可用键盘操作,状态与错误也提供读屏语义。
100
+
99
101
  Windows 访问目录也会在会话内被点明:运行非 WSL preset 的发行版工作区在输入框上方
100
102
  常驻一条警示;会话尚未开始时一键切换,已开始后修正访问记录。
101
103
 
package/lib/status.d.ts CHANGED
@@ -14,12 +14,13 @@
14
14
  * restored from the store below;
15
15
  * - `GET /api/wsl-env/status?distro=<name>` — one distro's quick doctor
16
16
  * report, digested to the same shape the `/wsl-doctor` command renders;
17
- * - `POST /api/wsl-env/status?distro=<name>` — the panel's full-check action:
17
+ * - `GET /api/wsl-env/status?distro=<name>&full=1` — one distro's full,
18
+ * read-only doctor report;
19
+ * - `POST /api/wsl-env/status?distro=<name>` — the explicit repair action:
18
20
  * a full doctor run with `--fix-owned`, which sweeps stale session scopes
19
21
  * and purges a broken agent cache, then re-verifies both and answers with
20
22
  * the same digest plus the `fix.*` rows. Nothing outside the plugin's own
21
- * state is touched (no packages, no Windows git config), so the panel
22
- * stays a diagnostic surface that can heal its own residue;
23
+ * state is touched (no packages, no Windows git config);
23
24
  * - `DELETE /api/wsl-env/status[?distro=<name>]` — the panel's clear action:
24
25
  * drops one distro's stored verdict, or every stored verdict when no distro
25
26
  * is named, and answers `{ cleared: <count> }`. Clearing is host-local on
@@ -125,7 +126,9 @@ export interface DistroStatusView {
125
126
  distro: string;
126
127
  /** `ready` and `blocked` come from the report; `error` means the run failed. */
127
128
  verdict: "ready" | "blocked" | "error";
128
- /** Whether this answer came from the full-check action (a full `--fix-owned` run). */
129
+ /** Whether this answer came from a full doctor run rather than the quick scope. */
130
+ full: boolean;
131
+ /** Whether this answer came from the explicit full `--fix-owned` repair action. */
129
132
  repaired: boolean;
130
133
  /** The doctor's fix rows: what the repair did and whether it verified. */
131
134
  repairs: StatusRepair[];
package/lib/status.js CHANGED
@@ -14,12 +14,13 @@
14
14
  * restored from the store below;
15
15
  * - `GET /api/wsl-env/status?distro=<name>` — one distro's quick doctor
16
16
  * report, digested to the same shape the `/wsl-doctor` command renders;
17
- * - `POST /api/wsl-env/status?distro=<name>` — the panel's full-check action:
17
+ * - `GET /api/wsl-env/status?distro=<name>&full=1` — one distro's full,
18
+ * read-only doctor report;
19
+ * - `POST /api/wsl-env/status?distro=<name>` — the explicit repair action:
18
20
  * a full doctor run with `--fix-owned`, which sweeps stale session scopes
19
21
  * and purges a broken agent cache, then re-verifies both and answers with
20
22
  * the same digest plus the `fix.*` rows. Nothing outside the plugin's own
21
- * state is touched (no packages, no Windows git config), so the panel
22
- * stays a diagnostic surface that can heal its own residue;
23
+ * state is touched (no packages, no Windows git config);
23
24
  * - `DELETE /api/wsl-env/status[?distro=<name>]` — the panel's clear action:
24
25
  * drops one distro's stored verdict, or every stored verdict when no distro
25
26
  * is named, and answers `{ cleared: <count> }`. Clearing is host-local on
@@ -169,11 +170,12 @@ function countsOf(findings) {
169
170
  * @param digest - the shared digest the command and the tool render.
170
171
  * @param distro - the distro the report answers for.
171
172
  * @param now - the run's timestamp.
172
- * @param repaired - whether the run was the full `--fix-owned` action.
173
+ * @param full - whether the run covered the full doctor scope.
174
+ * @param repaired - whether the run was the `--fix-owned` repair action.
173
175
  * @param source - who started the run.
174
176
  * @returns the panel view.
175
177
  */
176
- function viewOf(digest, distro, now, repaired, source) {
178
+ function viewOf(digest, distro, now, full, repaired, source) {
177
179
  // The fix rows are the repair's own narration, not findings about the
178
180
  // environment: keep them out of the failure/warning lists so a repair does
179
181
  // not double-list its work, and surface them separately.
@@ -211,6 +213,7 @@ function viewOf(digest, distro, now, repaired, source) {
211
213
  return {
212
214
  distro,
213
215
  verdict: digest.verdict === "ready" ? "ready" : "blocked",
216
+ full,
214
217
  repaired,
215
218
  repairs: repaired
216
219
  ? fixes.map((item) => ({
@@ -269,6 +272,7 @@ export function createStatusHandler(options) {
269
272
  at: view.checkedAt,
270
273
  view: {
271
274
  ...view,
275
+ full: view.full === true,
272
276
  repairs: Array.isArray(view.repairs) ? view.repairs : [],
273
277
  repairable: Array.isArray(view.repairable) ? view.repairable : [],
274
278
  failures: Array.isArray(view.failures) ? view.failures : [],
@@ -299,7 +303,7 @@ export function createStatusHandler(options) {
299
303
  list = { at: now(), names };
300
304
  return names;
301
305
  };
302
- const check = async (distro, refresh, repair = false, source = "user") => {
306
+ const check = async (distro, refresh, mode = "quick", source = "user") => {
303
307
  const cached = verdicts.get(distro);
304
308
  // A failure is a fact of this moment: it is kept for the list and the
305
309
  // store, but a plain GET re-runs instead of serving it as fresh.
@@ -308,22 +312,23 @@ export function createStatusHandler(options) {
308
312
  const at = now();
309
313
  let view;
310
314
  try {
311
- // A repair needs a full run: `--fix` refuses a scoped one because a
312
- // scoped report cannot re-verify what it did not probe. `--fix-owned`
313
- // keeps the loop on plugin-owned state (scopes, agent cache) — the panel
314
- // never installs packages or rewrites Windows-owned configuration.
315
- const argv = repair
315
+ // Repairs require the full scope so every changed condition is re-probed.
316
+ // The separate full mode is read-only and never passes a fix flag.
317
+ const argv = mode === "repair"
316
318
  ? ["--json", "--fix", "--fix-owned", "--distro", distro]
317
- : ["--json", "--quick", "--distro", distro];
319
+ : mode === "full"
320
+ ? ["--json", "--distro", distro]
321
+ : ["--json", "--quick", "--distro", distro];
318
322
  const raw = await options.runCli(argv, undefined, options.timeoutMs);
319
323
  const report = JSON.parse(raw);
320
324
  const live = mergeTakeoverReport(mergeAutoPresetSeam(report), options.providers?.() ?? []);
321
- view = viewOf(digestReport(live, distro), distro, at, repair, source);
325
+ view = viewOf(digestReport(live, distro), distro, at, mode !== "quick", mode === "repair", source);
322
326
  }
323
327
  catch (error) {
324
328
  view = {
325
329
  distro,
326
330
  verdict: "error",
331
+ full: mode !== "quick",
327
332
  repaired: false,
328
333
  repairs: [],
329
334
  repairable: [],
@@ -409,8 +414,10 @@ export function createStatusHandler(options) {
409
414
  }
410
415
  if (!names.includes(requested))
411
416
  return json({ error: t("statusUnknownDistro", { distro: requested }) }, 400);
412
- const background = !repair && url.searchParams.get("background") === "1";
413
- return json(await check(requested, refresh || repair, repair, background ? "background" : "user"));
417
+ const full = !repair && url.searchParams.get("full") === "1";
418
+ const background = !repair && !full && url.searchParams.get("background") === "1";
419
+ const mode = repair ? "repair" : full ? "full" : "quick";
420
+ return json(await check(requested, refresh || full || repair, mode, background ? "background" : "user"));
414
421
  };
415
422
  }
416
423
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-wsl-env",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "在 WSL 的 Linux 实例中打开项目工作区,在对应 Linux 空间中进行命令执行、运行 shell 脚本和文件访问,以获得全套 Linux Shell 工具链收益,并通过 bubblewrap 对命令进行沙箱隔离",
5
5
  "keywords": [
6
6
  "deepseek-harness",