@lmzhen/dsh-evolution-commands 0.36.2 → 0.37.1
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/lib/index.js +53 -53
- package/package.json +6 -6
package/lib/index.js
CHANGED
|
@@ -50,23 +50,23 @@ const FACT_HOMES = {
|
|
|
50
50
|
"fallback-map": "packages/INSTALL.md(命令兜底表)"
|
|
51
51
|
};
|
|
52
52
|
const FACT_LABELS = {
|
|
53
|
-
"platform-line": "
|
|
53
|
+
"platform-line": "兼容版本",
|
|
54
54
|
"family-version": "家族版本",
|
|
55
|
-
"install-form": "
|
|
56
|
-
"preset-ids": "
|
|
55
|
+
"install-form": "安装方式",
|
|
56
|
+
"preset-ids": "只读模式",
|
|
57
57
|
"readonly-contract": "只读说明",
|
|
58
58
|
"upgrade-order": "升级顺序",
|
|
59
|
-
"fallback-map": "
|
|
59
|
+
"fallback-map": "命令备用"
|
|
60
60
|
};
|
|
61
61
|
const RUNTIME_LABELS = {
|
|
62
|
-
"subagent-channel": "
|
|
63
|
-
"restricted-preset": "
|
|
64
|
-
"host-surface": "
|
|
62
|
+
"subagent-channel": "审阅/维护代理",
|
|
63
|
+
"restricted-preset": "只读模式",
|
|
64
|
+
"host-surface": "数据连接",
|
|
65
65
|
"session-fold": "会话事件读取",
|
|
66
66
|
"platform-services": "平台服务",
|
|
67
|
-
runs: "
|
|
67
|
+
runs: "运行记录",
|
|
68
68
|
"platform-pairing": "版本兼容",
|
|
69
|
-
"install-form-detected": "
|
|
69
|
+
"install-form-detected": "实际安装方式"
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
72
|
* The install form in reader-facing words. The M1..M4 ids stay internal (the runtime rows and
|
|
@@ -90,11 +90,11 @@ function factsOf(inputs) {
|
|
|
90
90
|
const values = {
|
|
91
91
|
"platform-line": inputs.platformLine.version + "(最低兼容 " + inputs.platformLine.floor + ")",
|
|
92
92
|
"family-version": inputs.familyVersion,
|
|
93
|
-
"install-form": FORM_WORDS[inputs.form.id] + "(" + (inputs.form.confidence === "declared" ? "
|
|
94
|
-
"preset-ids": "
|
|
95
|
-
"readonly-contract": "
|
|
93
|
+
"install-form": FORM_WORDS[inputs.form.id] + "(" + (inputs.form.confidence === "declared" ? "安装内容已确认" : "按已安装内容推断") + ")",
|
|
94
|
+
"preset-ids": "审阅、维护各有一个只读模式;另有 " + String(EVOLUTION_PRESET_IDS.length) + " 个基础预设可选",
|
|
95
|
+
"readonly-contract": "只读模式下能做什么,由该模式声明的工具清单决定(审阅和维护一样)",
|
|
96
96
|
"upgrade-order": "先升平台,再升家族,最后发布(详见 INSTALL 的升级说明)",
|
|
97
|
-
"fallback-map": String(Object.keys(COMMAND_FALLBACKS).length) + "
|
|
97
|
+
"fallback-map": String(Object.keys(COMMAND_FALLBACKS).length) + " 个功能页都有命令备用(见 INSTALL 的命令备用表)。"
|
|
98
98
|
};
|
|
99
99
|
return DIAGNOSTICS_FACT_KEYS.map((key) => ({
|
|
100
100
|
key,
|
|
@@ -107,49 +107,49 @@ function channelRow(channels) {
|
|
|
107
107
|
const unavailable = [channels.review, channels.maintenance].filter((state) => state.kind === "unavailable");
|
|
108
108
|
if (unavailable.length === 0) return {
|
|
109
109
|
key: "subagent-channel",
|
|
110
|
-
label: RUNTIME_LABELS["subagent-channel"] ?? "
|
|
110
|
+
label: RUNTIME_LABELS["subagent-channel"] ?? "审阅/维护代理",
|
|
111
111
|
status: "ok",
|
|
112
|
-
detail: "
|
|
112
|
+
detail: "审阅和维护代理都可用。"
|
|
113
113
|
};
|
|
114
114
|
const reasons = unavailable.map((state) => state.code + ": " + state.reason);
|
|
115
115
|
return {
|
|
116
116
|
key: "subagent-channel",
|
|
117
|
-
label: RUNTIME_LABELS["subagent-channel"] ?? "
|
|
117
|
+
label: RUNTIME_LABELS["subagent-channel"] ?? "审阅/维护代理",
|
|
118
118
|
status: "warn",
|
|
119
119
|
detail: reasons.join(";"),
|
|
120
|
-
remedy: "
|
|
120
|
+
remedy: "审阅和维护会明确标为不可用(不会静默改在当前会话里跑);运行 /evolution doctor 查看修复指引。"
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
function presetRow(presets) {
|
|
124
124
|
const entries = [presets.reviewer, presets.maintainer];
|
|
125
125
|
if (entries.every((entry) => entry === void 0)) return {
|
|
126
126
|
key: "restricted-preset",
|
|
127
|
-
label: RUNTIME_LABELS["restricted-preset"] ?? "
|
|
127
|
+
label: RUNTIME_LABELS["restricted-preset"] ?? "只读模式",
|
|
128
128
|
status: "unknown",
|
|
129
|
-
detail: "
|
|
130
|
-
remedy: "
|
|
129
|
+
detail: "平台没有提供预设列表,暂时无法检查只读模式。",
|
|
130
|
+
remedy: "这是平台安装不完整;重新安装或重启程序后再检查。"
|
|
131
131
|
};
|
|
132
132
|
const broken = entries.filter((entry) => entry !== void 0 && entry.broken !== void 0);
|
|
133
133
|
const missing = entries.filter((entry) => entry === void 0 || !entry.registered);
|
|
134
134
|
if (broken.length > 0) return {
|
|
135
135
|
key: "restricted-preset",
|
|
136
|
-
label: RUNTIME_LABELS["restricted-preset"] ?? "
|
|
136
|
+
label: RUNTIME_LABELS["restricted-preset"] ?? "只读模式",
|
|
137
137
|
status: "fail",
|
|
138
138
|
detail: errorText("e-324-restricted-preset-unavailable", { a1: broken.map((entry) => entry.broken ?? "").join(";") }),
|
|
139
139
|
remedy: "重新加载家族插件;若仍失败,运行 /evolution doctor 查看详情。"
|
|
140
140
|
};
|
|
141
141
|
if (missing.length > 0) return {
|
|
142
142
|
key: "restricted-preset",
|
|
143
|
-
label: RUNTIME_LABELS["restricted-preset"] ?? "
|
|
143
|
+
label: RUNTIME_LABELS["restricted-preset"] ?? "只读模式",
|
|
144
144
|
status: "warn",
|
|
145
|
-
detail: "
|
|
145
|
+
detail: "只读的审阅/维护模式还没启用(第一次运行审阅或维护时会自动创建)。",
|
|
146
146
|
remedy: "运行一次审阅或维护,或稍后重新检查。"
|
|
147
147
|
};
|
|
148
148
|
return {
|
|
149
149
|
key: "restricted-preset",
|
|
150
|
-
label: RUNTIME_LABELS["restricted-preset"] ?? "
|
|
150
|
+
label: RUNTIME_LABELS["restricted-preset"] ?? "只读模式",
|
|
151
151
|
status: "ok",
|
|
152
|
-
detail:
|
|
152
|
+
detail: "审阅和维护的只读模式都已就绪"
|
|
153
153
|
};
|
|
154
154
|
}
|
|
155
155
|
function hostRow(host, count) {
|
|
@@ -157,17 +157,17 @@ function hostRow(host, count) {
|
|
|
157
157
|
const fallback = COMMAND_FALLBACKS.approval.command.split(" … ")[0] ?? "";
|
|
158
158
|
return {
|
|
159
159
|
key: "host-surface",
|
|
160
|
-
label: RUNTIME_LABELS["host-surface"] ?? "
|
|
160
|
+
label: RUNTIME_LABELS["host-surface"] ?? "数据连接",
|
|
161
161
|
status: "warn",
|
|
162
162
|
detail: errorText("e-325-host-data-plane-unavailable") + "(" + (host.reason ?? "unknown") + ")",
|
|
163
|
-
remedy: "
|
|
163
|
+
remedy: "改用命令完成同样的操作:" + fallback + " 等;运行 /evolution doctor 查看服务状态。"
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
const remote = host.deploymentAllowsRemote === true ? "
|
|
167
|
-
const mounted = count === void 0 ? "
|
|
166
|
+
const remote = host.deploymentAllowsRemote === true ? "允许远程访问(按平台设置)" : "仅限本机访问(按平台设置)";
|
|
167
|
+
const mounted = count === void 0 ? "已就绪" : "已就绪 " + String(count.mounted) + "/" + String(count.total);
|
|
168
168
|
return {
|
|
169
169
|
key: "host-surface",
|
|
170
|
-
label: RUNTIME_LABELS["host-surface"] ?? "
|
|
170
|
+
label: RUNTIME_LABELS["host-surface"] ?? "数据连接",
|
|
171
171
|
status: "ok",
|
|
172
172
|
detail: mounted + ";" + remote
|
|
173
173
|
};
|
|
@@ -176,30 +176,30 @@ function pairingRow(inputs) {
|
|
|
176
176
|
switch (inputs.platformPairing ?? "unknown") {
|
|
177
177
|
case "in-window": return {
|
|
178
178
|
key: "platform-pairing",
|
|
179
|
-
label: RUNTIME_LABELS["platform-pairing"] ?? "
|
|
179
|
+
label: RUNTIME_LABELS["platform-pairing"] ?? "版本兼容",
|
|
180
180
|
status: "ok",
|
|
181
|
-
detail: "
|
|
181
|
+
detail: "程序版本 " + String(inputs.hostVersion) + " 在兼容范围内(" + inputs.platformLine.version + ")"
|
|
182
182
|
};
|
|
183
183
|
case "host-newer": return {
|
|
184
184
|
key: "platform-pairing",
|
|
185
|
-
label: RUNTIME_LABELS["platform-pairing"] ?? "
|
|
185
|
+
label: RUNTIME_LABELS["platform-pairing"] ?? "版本兼容",
|
|
186
186
|
status: "warn",
|
|
187
|
-
detail: "
|
|
188
|
-
remedy: "
|
|
187
|
+
detail: "程序已经更新(" + String(inputs.hostVersion) + ",本插件声明 " + inputs.platformLine.version + ")。",
|
|
188
|
+
remedy: "先升级程序,再升级本插件。"
|
|
189
189
|
};
|
|
190
190
|
case "out-of-window": return {
|
|
191
191
|
key: "platform-pairing",
|
|
192
|
-
label: RUNTIME_LABELS["platform-pairing"] ?? "
|
|
192
|
+
label: RUNTIME_LABELS["platform-pairing"] ?? "版本兼容",
|
|
193
193
|
status: "fail",
|
|
194
|
-
detail: "
|
|
195
|
-
remedy: "
|
|
194
|
+
detail: "程序版本 " + String(inputs.hostVersion) + " 低于最低兼容版本(" + inputs.platformLine.floor + ")。",
|
|
195
|
+
remedy: "先把程序升/降到兼容版本,再重启本插件。"
|
|
196
196
|
};
|
|
197
197
|
case "unknown": return {
|
|
198
198
|
key: "platform-pairing",
|
|
199
|
-
label: RUNTIME_LABELS["platform-pairing"] ?? "
|
|
199
|
+
label: RUNTIME_LABELS["platform-pairing"] ?? "版本兼容",
|
|
200
200
|
status: "unknown",
|
|
201
|
-
detail: inputs.hostVersion === void 0 ? "
|
|
202
|
-
remedy: "
|
|
201
|
+
detail: inputs.hostVersion === void 0 ? "读不到程序版本。" : "无法判断版本是否兼容。",
|
|
202
|
+
remedy: "在会话里运行 /evolution doctor。"
|
|
203
203
|
};
|
|
204
204
|
}
|
|
205
205
|
}
|
|
@@ -212,52 +212,52 @@ function runtimeOf(inputs) {
|
|
|
212
212
|
hostRow(inputs.host, inputs.hostRouteCount),
|
|
213
213
|
fold ? {
|
|
214
214
|
key: "session-fold",
|
|
215
|
-
label: RUNTIME_LABELS["session-fold"] ?? "
|
|
215
|
+
label: RUNTIME_LABELS["session-fold"] ?? "会话事件读取",
|
|
216
216
|
status: "ok",
|
|
217
217
|
detail: "事件读取通道正常:对话内容会被读取,其余记录忽略。"
|
|
218
218
|
} : {
|
|
219
219
|
key: "session-fold",
|
|
220
|
-
label: RUNTIME_LABELS["session-fold"] ?? "
|
|
220
|
+
label: RUNTIME_LABELS["session-fold"] ?? "会话事件读取",
|
|
221
221
|
status: "fail",
|
|
222
222
|
detail: "事件读取组件缺失,无法确认读取通道正常。",
|
|
223
223
|
remedy: "重新安装完整功能包(evolution-all)。"
|
|
224
224
|
},
|
|
225
225
|
missing.length === 0 ? {
|
|
226
226
|
key: "platform-services",
|
|
227
|
-
label: RUNTIME_LABELS["platform-services"] ?? "
|
|
227
|
+
label: RUNTIME_LABELS["platform-services"] ?? "平台服务",
|
|
228
228
|
status: "ok",
|
|
229
|
-
detail: "
|
|
229
|
+
detail: "需要的服务都已就绪"
|
|
230
230
|
} : {
|
|
231
231
|
key: "platform-services",
|
|
232
|
-
label: RUNTIME_LABELS["platform-services"] ?? "
|
|
232
|
+
label: RUNTIME_LABELS["platform-services"] ?? "平台服务",
|
|
233
233
|
status: "warn",
|
|
234
234
|
detail: "缺少:" + missing.join("、"),
|
|
235
|
-
remedy: "
|
|
235
|
+
remedy: "安装 evolution-host 或 evolution-all,或检查配置。"
|
|
236
236
|
},
|
|
237
237
|
inputs.runs.orphaned > 0 ? {
|
|
238
238
|
key: "runs",
|
|
239
239
|
label: RUNTIME_LABELS.runs ?? "运行登记",
|
|
240
240
|
status: "warn",
|
|
241
|
-
detail: "
|
|
242
|
-
remedy: "运行 /evolution maintain status
|
|
241
|
+
detail: "正在运行 " + String(inputs.runs.running) + " 个,遗留 " + String(inputs.runs.orphaned) + " 个",
|
|
242
|
+
remedy: "运行 /evolution maintain status 查看并处理遗留运行。"
|
|
243
243
|
} : {
|
|
244
244
|
key: "runs",
|
|
245
245
|
label: RUNTIME_LABELS.runs ?? "运行登记",
|
|
246
246
|
status: "ok",
|
|
247
|
-
detail: "
|
|
247
|
+
detail: "正在运行 " + String(inputs.runs.running) + " 个,没有遗留"
|
|
248
248
|
},
|
|
249
249
|
pairingRow(inputs),
|
|
250
250
|
inputs.form.confidence === "declared" ? {
|
|
251
251
|
key: "install-form-detected",
|
|
252
252
|
label: RUNTIME_LABELS["install-form-detected"] ?? "实际安装形态",
|
|
253
253
|
status: "ok",
|
|
254
|
-
detail: FORM_WORDS[inputs.form.id] + "
|
|
254
|
+
detail: FORM_WORDS[inputs.form.id] + "(已确认)"
|
|
255
255
|
} : {
|
|
256
256
|
key: "install-form-detected",
|
|
257
257
|
label: RUNTIME_LABELS["install-form-detected"] ?? "实际安装形态",
|
|
258
258
|
status: "warn",
|
|
259
259
|
detail: FORM_WORDS[inputs.form.id] + "(按已安装内容推断:" + inputs.form.evidence.join("、") + ")",
|
|
260
|
-
remedy: "
|
|
260
|
+
remedy: "在配置里明确写出安装方式,并核对 INSTALL 的安装方式表。"
|
|
261
261
|
}
|
|
262
262
|
].sort((a, b) => a.key.localeCompare(b.key));
|
|
263
263
|
}
|
|
@@ -285,7 +285,7 @@ function unavailableDoctorView(now, reason) {
|
|
|
285
285
|
key,
|
|
286
286
|
label: RUNTIME_LABELS[key] ?? key,
|
|
287
287
|
status: "unknown",
|
|
288
|
-
detail: "
|
|
288
|
+
detail: "读不到诊断所需的信息:" + reason,
|
|
289
289
|
remedy: "运行 /evolution doctor 重试;若持续失败,检查宿主日志。"
|
|
290
290
|
}));
|
|
291
291
|
return {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-commands",
|
|
3
3
|
"description": "Human commands for the evolution family (/evolution pending|curator|maintain|doctor) (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.37.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@deepseek-ai/schemastery": "^3.18.5",
|
|
30
|
-
"@lmzhen/dsh-evolution-approval": "^0.
|
|
31
|
-
"@lmzhen/dsh-evolution-core": "^0.
|
|
32
|
-
"@lmzhen/dsh-evolution-maintenance": "^0.
|
|
33
|
-
"@lmzhen/dsh-evolution-state-storage": "^0.
|
|
30
|
+
"@lmzhen/dsh-evolution-approval": "^0.37.1",
|
|
31
|
+
"@lmzhen/dsh-evolution-core": "^0.37.1",
|
|
32
|
+
"@lmzhen/dsh-evolution-maintenance": "^0.37.1",
|
|
33
|
+
"@lmzhen/dsh-evolution-state-storage": "^0.37.1"
|
|
34
34
|
},
|
|
35
35
|
"optionalDependencies": {
|
|
36
|
-
"@lmzhen/dsh-evolution-agent-preset": "^0.
|
|
36
|
+
"@lmzhen/dsh-evolution-agent-preset": "^0.37.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@deepseek-ai/cordis": "^4.0.5",
|