@lumi-ai-lab/harness-data 0.0.15 → 0.0.16
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/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -205,8 +205,10 @@ export async function buildAndCheck(runtimeDir, options = {}) {
|
|
|
205
205
|
return { ok: true, docs, recall, runtimeDocs };
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
export function printDoctorSummary(doctor) {
|
|
209
|
-
const
|
|
208
|
+
export function printDoctorSummary(doctor, options = {}) {
|
|
209
|
+
const nonBlocking = options.nonBlocking || (() => false);
|
|
210
|
+
const failed = doctor.checks.filter((check) => !check.ok && !nonBlocking(check));
|
|
211
|
+
const warnings = doctor.checks.filter((check) => !check.ok && nonBlocking(check));
|
|
210
212
|
if (!failed.length) {
|
|
211
213
|
ok("runtime");
|
|
212
214
|
ok("wikis/spec");
|
|
@@ -217,9 +219,11 @@ export function printDoctorSummary(doctor) {
|
|
|
217
219
|
ok("CAS 凭证");
|
|
218
220
|
ok("CMR Token");
|
|
219
221
|
ok("Indicators Token");
|
|
220
|
-
ok("Agent Hook");
|
|
222
|
+
if (!warnings.some((check) => check.name.startsWith("Agent hook"))) ok("Agent Hook");
|
|
223
|
+
for (const check of warnings) warn(`${check.name}${check.detail ? ` (${check.detail})` : ""}`);
|
|
221
224
|
return;
|
|
222
225
|
}
|
|
226
|
+
for (const check of warnings) warn(`${check.name}${check.detail ? ` (${check.detail})` : ""}`);
|
|
223
227
|
for (const check of failed) fail(`${check.name}${check.detail ? ` (${check.detail})` : ""}`);
|
|
224
228
|
}
|
|
225
229
|
|
package/src/commands/update.js
CHANGED
|
@@ -13,6 +13,10 @@ import { buildAndCheck, installRuntimeBundle, printDoctorSummary } from "./insta
|
|
|
13
13
|
import { collectDoctor } from "./doctor.js";
|
|
14
14
|
import { action, blank, header, ok, shortSha, skip, step, warn } from "../lib/log.js";
|
|
15
15
|
|
|
16
|
+
export function isNonBlockingUpdateDoctorCheck(check) {
|
|
17
|
+
return check.name === "Agent hook" || check.name.startsWith("Agent hook .");
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
async function npmLatest() {
|
|
17
21
|
try {
|
|
18
22
|
const response = await fetch("https://registry.npmjs.org/@lumi-ai-lab%2Fharness-data/latest", { signal: AbortSignal.timeout(5000) });
|
|
@@ -184,8 +188,8 @@ export async function updateCommand(options = {}) {
|
|
|
184
188
|
step(6, 6, "安装校验");
|
|
185
189
|
if (changed) {
|
|
186
190
|
const doctor = await collectDoctor(runtimeDir, trackingOptions);
|
|
187
|
-
printDoctorSummary(doctor);
|
|
188
|
-
if (doctor.checks.some((check) => !check.ok)) throw new Error("doctor failed; update is incomplete");
|
|
191
|
+
printDoctorSummary(doctor, { nonBlocking: isNonBlockingUpdateDoctorCheck });
|
|
192
|
+
if (doctor.checks.some((check) => !check.ok && !isNonBlockingUpdateDoctorCheck(check))) throw new Error("doctor failed; update is incomplete");
|
|
189
193
|
writeState(runtimeDir, {
|
|
190
194
|
...state,
|
|
191
195
|
runtimeTag,
|