@moonquake2004/dsh-doctor 0.3.1 → 0.3.2
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.md +1 -0
- package/README.zh.md +1 -0
- package/dsh-doctor.mjs +29 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ With `--envelope` (doctor-contract mode): `0` = all pass · `1` = any WARN · `2
|
|
|
47
47
|
| P4 | `file:` dependencies intact | [#1197](https://github.com/deepseek-ai/deepseek-harness/discussions/1197) |
|
|
48
48
|
| P5 | no top-level `@deepseek-ai/*` duplication (dual module instances) | [#1486](https://github.com/deepseek-ai/deepseek-harness/discussions/1486), [#1697](https://github.com/deepseek-ai/deepseek-harness/discussions/1697) |
|
|
49
49
|
| P7 | `cordis.patch.yml` structural lint (`~ insert:` null-literal typo, tab indentation, missing colon → UI won't boot) | [#1724](https://github.com/deepseek-ai/deepseek-harness/discussions/1724) |
|
|
50
|
+
| P12 | profile-installed bundle version vs running CLI (warn on divergence; the web "Doctor" panel / `/dsh-doctor/run` API runs the bundle) | [#1719](https://github.com/deepseek-ai/deepseek-harness/discussions/1719) v1.1 `installed_bundle` |
|
|
50
51
|
|
|
51
52
|
### session
|
|
52
53
|
| ID | Checks | Discussion |
|
package/README.zh.md
CHANGED
|
@@ -42,6 +42,7 @@ node dsh-doctor.mjs --no-catalog # 不拉远程目录(只用内置副
|
|
|
42
42
|
| P4 | `file:` 依赖完整 | [#1197](https://github.com/deepseek-ai/deepseek-harness/discussions/1197) |
|
|
43
43
|
| P5 | 顶层无 `@deepseek-ai/*` 重复(双模块实例) | [#1486](https://github.com/deepseek-ai/deepseek-harness/discussions/1486), [#1697](https://github.com/deepseek-ai/deepseek-harness/discussions/1697) |
|
|
44
44
|
| P7 | `cordis.patch.yml` 结构 lint(`~ insert:` null 字面量、tab 缩进、缺冒号、顶层映射+序列混排 → UI 打不开) | [#1724](https://github.com/deepseek-ai/deepseek-harness/discussions/1724) |
|
|
45
|
+
| P12 | profile 内 bundle 版本 vs 运行 CLI(分歧 warn;web「诊断」面板 / `/dsh-doctor/run` API 跑的是 bundle) | [#1719](https://github.com/deepseek-ai/deepseek-harness/discussions/1719) v1.1 `installed_bundle` |
|
|
45
46
|
|
|
46
47
|
### session
|
|
47
48
|
| ID | 检查 | 对应讨论 |
|
package/dsh-doctor.mjs
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* P9 ctx.settings 未声明 inject: ['settings'](#1904⑤:先于 settings 就绪激活 → namespace not registered)
|
|
15
15
|
* P10 inject 引用客户端专属服务(#1947:@deepseek-ai/dsh-client-* 服务端永不提供 → Fiber 永久 PENDING → web boot 失败)
|
|
16
16
|
* P11 已装 bundle 的 main 入口产物缺失(#1965:市场装未构建源码树 → ERR_MODULE_NOT_FOUND → boot 崩)
|
|
17
|
+
* P12 profile 内 bundle 版本 vs 运行 CLI 版本(#1719 v1.1 `installed_bundle` 候选:web 面板/API 跑的是 profile 里装的 bundle,可与独立 CLI 版本不一致)
|
|
17
18
|
* [session]
|
|
18
19
|
* S1 孤儿 tool_call(#1363:assistant tool_calls 无对应 tool 结果 → INVALID_REQUEST)
|
|
19
20
|
* S2 未闭合 turn(#466/#1265:turn/start 无 turn/end → 会话永久"运行中")
|
|
@@ -530,6 +531,32 @@ function checkProfile(name) {
|
|
|
530
531
|
}
|
|
531
532
|
if (entryIssues.length) report('profile', 'P11', false, `已装 bundle 的 main 入口缺失(#1965:市场装源码不跑构建 → ERR_MODULE_NOT_FOUND → dsh web boot 崩溃): ${entryIssues.join('; ')}`, '在插件目录跑构建(pnpm install && pnpm run build 产出 main 指向的文件),或改用打包好的 npm 包安装;monorepo 插件需装子包(dsh-market #18 同族)');
|
|
532
533
|
else report('profile', 'P11', true, '已装 bundle 的 main 入口产物均在', undefined);
|
|
534
|
+
|
|
535
|
+
// P12:profile 内 bundle 版本 vs 运行 CLI 版本(#1719 v1.1 `installed_bundle` 候选)
|
|
536
|
+
// web 设置「诊断」面板与 /dsh-doctor/run API 跑的是 profile 里装的 bundle;独立 CLI(checkout/npx)是另一个副本——
|
|
537
|
+
// Layer-B 自更新只比 npm latest vs 运行模块,profile 内 bundle 落后/超前都不报警(dsh-win32/bundle 同坑,sjh9714 先发现的)。
|
|
538
|
+
// 语义(#1719 提名):ok = 版本一致;warn = 分歧。profile 未装本插件 = 无对比对象,放行。
|
|
539
|
+
try {
|
|
540
|
+
const selfName = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).name ?? '@moonquake2004/dsh-doctor';
|
|
541
|
+
// 安装形态两种都找:npm scoped 名(@moonquake2004/dsh-doctor)与 file: 依赖的裸名(dsh-doctor)
|
|
542
|
+
let bundlePkg = null;
|
|
543
|
+
for (const cand of [selfName, 'dsh-doctor']) {
|
|
544
|
+
const p = join(dir, 'node_modules', cand, 'package.json');
|
|
545
|
+
if (existsSync(p)) { bundlePkg = p; break; }
|
|
546
|
+
}
|
|
547
|
+
if (!bundlePkg) {
|
|
548
|
+
report('profile', 'P12-bundle-version', true, 'profile 未安装 dsh-doctor bundle,跳过版本对比(CLI 独立运行)', undefined);
|
|
549
|
+
} else {
|
|
550
|
+
const bundleVersion = JSON.parse(readFileSync(bundlePkg, 'utf8')).version;
|
|
551
|
+
const cliVersion = localVersion();
|
|
552
|
+
const same = bundleVersion === cliVersion;
|
|
553
|
+
report('profile', 'P12-bundle-version', same,
|
|
554
|
+
same ? `profile 内 bundle 版本 ${bundleVersion} 与运行 CLI ${cliVersion} 一致` : `profile 内 bundle 版本 ${bundleVersion} ≠ 运行 CLI ${cliVersion}(web 面板/API 跑的是 bundle,两边行为可能不一致)`,
|
|
555
|
+
same ? undefined : `同步安装版本:dsh plugin --profile ${name} update ${selfName}(或让 CLI 与 bundle 走同一安装方式)`);
|
|
556
|
+
}
|
|
557
|
+
} catch (e) {
|
|
558
|
+
report('profile', 'P12-bundle-version', false, `bundle 版本对比异常: ${e.message.slice(0, 60)}`, undefined);
|
|
559
|
+
}
|
|
533
560
|
}
|
|
534
561
|
|
|
535
562
|
/* ================= session ================= */
|
|
@@ -762,9 +789,10 @@ function scanAllSessions() {
|
|
|
762
789
|
const REMOTE_CATALOG_URL = 'https://raw.githubusercontent.com/moonquake2004/dsh-doctor/main/plugin/checks.json';
|
|
763
790
|
const CATALOG_TTL_MS = 6 * 60 * 60 * 1000; // 6h:新检查最长 6h 内自动生效
|
|
764
791
|
const catalogSeverity = new Map(); // catalog 检查 id → severity('error' | 'warn')
|
|
765
|
-
// v1 词汇表 r5 对齐(#1719):E1-pnpm 缺失=warn(corepack 可恢复)、E3-node 越界=warn(EBADENGINE
|
|
792
|
+
// v1 词汇表 r5 对齐(#1719):E1-pnpm 缺失=warn(corepack 可恢复)、E3-node 越界=warn(EBADENGINE 语义)、P12 bundle 版本分歧=warn(v1.1 `installed_bundle` 候选)——均不翻退出码
|
|
766
793
|
catalogSeverity.set('E1-pnpm', 'warn');
|
|
767
794
|
catalogSeverity.set('E3-node', 'warn');
|
|
795
|
+
catalogSeverity.set('P12-bundle-version', 'warn');
|
|
768
796
|
|
|
769
797
|
function bundledCatalog() {
|
|
770
798
|
const p = new URL('./checks.json', import.meta.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonquake2004/dsh-doctor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Offline diagnostic for DeepSeek Harness — 25 built-in + 5 catalog checks across env/profile/session (Layer A checks-as-data), self-update (Layer B), and a semi-automatic LLM observer (Layer C, --observe); Doctor panel in web UI settings.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|