@moonquake2004/dsh-doctor 0.3.2 → 0.3.3
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/dsh-doctor.mjs +10 -4
- package/package.json +1 -1
package/dsh-doctor.mjs
CHANGED
|
@@ -535,23 +535,29 @@ function checkProfile(name) {
|
|
|
535
535
|
// P12:profile 内 bundle 版本 vs 运行 CLI 版本(#1719 v1.1 `installed_bundle` 候选)
|
|
536
536
|
// web 设置「诊断」面板与 /dsh-doctor/run API 跑的是 profile 里装的 bundle;独立 CLI(checkout/npx)是另一个副本——
|
|
537
537
|
// Layer-B 自更新只比 npm latest vs 运行模块,profile 内 bundle 落后/超前都不报警(dsh-win32/bundle 同坑,sjh9714 先发现的)。
|
|
538
|
-
// 语义(#1719
|
|
538
|
+
// 语义(#1719 合稿,sjh9714 四态分析):pass/warn 两态 + detail 注明条件——
|
|
539
|
+
// manifest 未声明 = pass(CLI 独立运行);manifest 声明但 node_modules 缺失 = warn(manifest 撒谎,运行时从不加载);
|
|
540
|
+
// 已装且版本一致 = pass;已装但版本分歧 = warn(detail 含 age-gate 提示,升级可能被 pnpm-workspace.yaml 的
|
|
541
|
+
// minimumReleaseAgeExclude 年龄门暂缓一天,指令不再静默无效——sjh9714 实测)。
|
|
539
542
|
try {
|
|
540
543
|
const selfName = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).name ?? '@moonquake2004/dsh-doctor';
|
|
544
|
+
const listed = Object.keys(deps).some((k) => k === selfName || k === 'dsh-doctor');
|
|
541
545
|
// 安装形态两种都找:npm scoped 名(@moonquake2004/dsh-doctor)与 file: 依赖的裸名(dsh-doctor)
|
|
542
546
|
let bundlePkg = null;
|
|
543
547
|
for (const cand of [selfName, 'dsh-doctor']) {
|
|
544
548
|
const p = join(dir, 'node_modules', cand, 'package.json');
|
|
545
549
|
if (existsSync(p)) { bundlePkg = p; break; }
|
|
546
550
|
}
|
|
547
|
-
if (!bundlePkg) {
|
|
548
|
-
report('profile', 'P12-bundle-version', true, 'profile
|
|
551
|
+
if (!listed && !bundlePkg) {
|
|
552
|
+
report('profile', 'P12-bundle-version', true, 'profile 未声明也未安装 dsh-doctor bundle,跳过版本对比(CLI 独立运行)', undefined);
|
|
553
|
+
} else if (listed && !bundlePkg) {
|
|
554
|
+
report('profile', 'P12-bundle-version', false, `profile 的 package.json 声明了 ${selfName} 依赖,但 node_modules 里没有对应包(manifest 与运行时不一致,web 面板/API 实际加载不到)`, `dsh plugin --profile ${name} install ${selfName}(或先移除该依赖再重装)`);
|
|
549
555
|
} else {
|
|
550
556
|
const bundleVersion = JSON.parse(readFileSync(bundlePkg, 'utf8')).version;
|
|
551
557
|
const cliVersion = localVersion();
|
|
552
558
|
const same = bundleVersion === cliVersion;
|
|
553
559
|
report('profile', 'P12-bundle-version', same,
|
|
554
|
-
same ? `profile 内 bundle 版本 ${bundleVersion} 与运行 CLI ${cliVersion} 一致` : `profile 内 bundle 版本 ${bundleVersion} ≠ 运行 CLI ${cliVersion}(web 面板/API 跑的是 bundle
|
|
560
|
+
same ? `profile 内 bundle 版本 ${bundleVersion} 与运行 CLI ${cliVersion} 一致` : `profile 内 bundle 版本 ${bundleVersion} ≠ 运行 CLI ${cliVersion}(web 面板/API 跑的是 bundle,两边行为可能不一致;若刚发布过新版本,升级可能被 pnpm-workspace.yaml 的 minimumReleaseAgeExclude 年龄门暂缓,可次日重试)`,
|
|
555
561
|
same ? undefined : `同步安装版本:dsh plugin --profile ${name} update ${selfName}(或让 CLI 与 bundle 走同一安装方式)`);
|
|
556
562
|
}
|
|
557
563
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonquake2004/dsh-doctor",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
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": [
|