@lark-apaas/openclaw-scripts-diagnose-cli 0.1.16 → 0.1.17-alpha.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/dist/index.cjs +17 -31
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,7 +52,7 @@ node_assert = __toESM(node_assert);
|
|
|
52
52
|
* it terse and parseable.
|
|
53
53
|
*/
|
|
54
54
|
function getVersion() {
|
|
55
|
-
return "0.1.
|
|
55
|
+
return "0.1.17-alpha.1";
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/rule-engine/base.ts
|
|
@@ -3223,7 +3223,7 @@ BuiltinPluginMissingRule = __decorate([Rule({
|
|
|
3223
3223
|
key: "builtin_plugin_missing",
|
|
3224
3224
|
description: "检查所有内置扩展插件(openclaw-lark、openclaw-extension-miaoda 等)是否已在磁盘安装;缺失时提示重新安装(实验性)",
|
|
3225
3225
|
dependsOn: ["config_syntax_check"],
|
|
3226
|
-
repairMode: "
|
|
3226
|
+
repairMode: "check-only",
|
|
3227
3227
|
level: "critical",
|
|
3228
3228
|
profile: "experimental"
|
|
3229
3229
|
})], BuiltinPluginMissingRule);
|
|
@@ -10602,19 +10602,25 @@ function runChannelsProbe(timeoutMs = 6e4, { ignoreProbeFailed = true } = {}) {
|
|
|
10602
10602
|
execError = err.message;
|
|
10603
10603
|
const stderrRaw = err.stderr;
|
|
10604
10604
|
stderrText = (typeof stderrRaw === "string" ? stderrRaw : stderrRaw?.toString("utf-8") ?? "").trim();
|
|
10605
|
-
if (stderrText) console.error(`channels-probe: stderr from CLI: ${stderrText}`);
|
|
10606
10605
|
}
|
|
10607
|
-
if (stdout.trim())
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10606
|
+
if (stdout.trim()) {
|
|
10607
|
+
const parsed = parseChannelsProbeOutput(stdout, { ignoreProbeFailed });
|
|
10608
|
+
const feishuConfigInvalidFromStderr = stderrText.includes(FEISHU_INVALID_CONFIG_MSG);
|
|
10609
|
+
return {
|
|
10610
|
+
available: true,
|
|
10611
|
+
rawOutput: stdout.trim(),
|
|
10612
|
+
rawStderr: stderrText || void 0,
|
|
10613
|
+
...parsed,
|
|
10614
|
+
feishuConfigInvalid: parsed.feishuConfigInvalid || feishuConfigInvalidFromStderr
|
|
10615
|
+
};
|
|
10616
|
+
}
|
|
10612
10617
|
return {
|
|
10613
10618
|
available: false,
|
|
10614
10619
|
gatewayReachable: false,
|
|
10615
10620
|
feishuConfigInvalid: stderrText.includes(FEISHU_INVALID_CONFIG_MSG),
|
|
10616
10621
|
accounts: [],
|
|
10617
10622
|
anyAccountWorking: false,
|
|
10623
|
+
rawStderr: stderrText || void 0,
|
|
10618
10624
|
error: execError ?? "no output from openclaw channels status --probe"
|
|
10619
10625
|
};
|
|
10620
10626
|
}
|
|
@@ -10714,7 +10720,7 @@ async function reportCliRun(opts) {
|
|
|
10714
10720
|
//#region src/help.ts
|
|
10715
10721
|
const BIN = "mclaw-diagnose";
|
|
10716
10722
|
function versionBanner() {
|
|
10717
|
-
return `v0.1.
|
|
10723
|
+
return `v0.1.17-alpha.1`;
|
|
10718
10724
|
}
|
|
10719
10725
|
const COMMANDS = [
|
|
10720
10726
|
{
|
|
@@ -11252,28 +11258,12 @@ function planCtxPopulate(opts) {
|
|
|
11252
11258
|
//#endregion
|
|
11253
11259
|
//#region src/slardar/reporter.ts
|
|
11254
11260
|
let slardarInitialized = false;
|
|
11255
|
-
/**
|
|
11256
|
-
* 解析实际运行环境,映射到 Slardar 支持的 env 值。
|
|
11257
|
-
*
|
|
11258
|
-
* 仅处理 FORCE_FRAMEWORK_ENVIRONMENT(studio_server 在沙箱启动时注入):
|
|
11259
|
-
* boe / pre → "dev"(非生产环境,避免污染线上指标)
|
|
11260
|
-
* online → "online"
|
|
11261
|
-
* 未识别到有效值时返回 undefined,交由 openclaw-slardar 内部逻辑决定
|
|
11262
|
-
* (MIAODA_SLARDAR_ENV / 编译期常量 / 默认 online)。
|
|
11263
|
-
*/
|
|
11264
|
-
function resolveSlardarEnv() {
|
|
11265
|
-
const ffe = (process.env.FORCE_FRAMEWORK_ENVIRONMENT ?? "").trim().toLowerCase();
|
|
11266
|
-
if (ffe === "online") return "online";
|
|
11267
|
-
if (ffe === "boe" || ffe === "pre") return "dev";
|
|
11268
|
-
}
|
|
11269
11261
|
function initDiagnoseSlardar() {
|
|
11270
11262
|
if (slardarInitialized) return;
|
|
11271
11263
|
slardarInitialized = true;
|
|
11272
|
-
const env = resolveSlardarEnv();
|
|
11273
11264
|
initSlardar({
|
|
11274
11265
|
bid: "apaas_miaoda",
|
|
11275
|
-
release: getVersion()
|
|
11276
|
-
...env ? { env } : {}
|
|
11266
|
+
release: getVersion()
|
|
11277
11267
|
});
|
|
11278
11268
|
process.on("beforeExit", flushDiagnoseSlardar);
|
|
11279
11269
|
}
|
|
@@ -11334,7 +11324,6 @@ function reportDoctorRunToSlardar(opts) {
|
|
|
11334
11324
|
* - validation_error:安装后校验失败信息(对应 UpgradeLarkResult.validationError)
|
|
11335
11325
|
* - error:命令级错误信息(对应 UpgradeLarkResult.error)
|
|
11336
11326
|
* - port_check_ok:端口存活检测结果(对应 UpgradeLarkResult.portCheckOk,未执行时为空)
|
|
11337
|
-
* - fix_status:场景专属修复状态(对应 UpgradeLarkResult.fixStatus,非场景命令时为空)
|
|
11338
11327
|
* - result:执行结果一行摘要(派生字段,见 buildUpgradeLarkResultSummary)
|
|
11339
11328
|
* - log_file:日志文件绝对路径(对应 UpgradeLarkResult.logFile)
|
|
11340
11329
|
*
|
|
@@ -11366,7 +11355,6 @@ function reportUpgradeLarkToSlardar(opts) {
|
|
|
11366
11355
|
validation_error: opts.validationError ?? "",
|
|
11367
11356
|
error: opts.error ?? "",
|
|
11368
11357
|
port_check_ok: String(opts.portCheckOk ?? ""),
|
|
11369
|
-
fix_status: opts.fixStatus ?? "",
|
|
11370
11358
|
result: opts.resultSummary,
|
|
11371
11359
|
log_file: opts.logFile
|
|
11372
11360
|
},
|
|
@@ -11523,6 +11511,7 @@ function probeChannels(label, log, timeoutMs) {
|
|
|
11523
11511
|
if (r.error) log(` ${label} error: ${r.error}`);
|
|
11524
11512
|
if (r.gatewayReachable != null) log(` ${label} gatewayReachable: ${r.gatewayReachable}`);
|
|
11525
11513
|
for (const acct of r.accounts ?? []) log(` ${label} account ${acct.id}: isWorking=${acct.isWorking} bits=[${acct.bits.join(",")}]`);
|
|
11514
|
+
if (r.rawStderr) log(` ${label} stderr:\n${r.rawStderr}`);
|
|
11526
11515
|
if (r.rawOutput) log(` ${label} raw output:\n${r.rawOutput}`);
|
|
11527
11516
|
return r;
|
|
11528
11517
|
} catch (e) {
|
|
@@ -12520,7 +12509,6 @@ async function main() {
|
|
|
12520
12509
|
resultStatus: "failed",
|
|
12521
12510
|
error: upgradeLockErr,
|
|
12522
12511
|
logFile: "",
|
|
12523
|
-
fixStatus,
|
|
12524
12512
|
resultSummary: buildUpgradeLarkResultSummary(failResult, checkOnly)
|
|
12525
12513
|
});
|
|
12526
12514
|
node_process.default.exitCode = 1;
|
|
@@ -12550,7 +12538,6 @@ async function main() {
|
|
|
12550
12538
|
validationError: result.validationError,
|
|
12551
12539
|
error: result.error,
|
|
12552
12540
|
portCheckOk: result.portCheckOk,
|
|
12553
|
-
fixStatus: result.fixStatus,
|
|
12554
12541
|
timing: result.timing
|
|
12555
12542
|
});
|
|
12556
12543
|
try {
|
|
@@ -12613,7 +12600,6 @@ main().catch((err) => {
|
|
|
12613
12600
|
resultStatus: "failed",
|
|
12614
12601
|
error: msg,
|
|
12615
12602
|
logFile: "",
|
|
12616
|
-
fixStatus,
|
|
12617
12603
|
resultSummary: buildUpgradeLarkResultSummary(failResult, checkOnly)
|
|
12618
12604
|
});
|
|
12619
12605
|
} else if ([
|