@lark-apaas/openclaw-scripts-diagnose-cli 0.1.17-alpha.0 → 0.1.17
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 +27 -4
- 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.17
|
|
55
|
+
return "0.1.17";
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/rule-engine/base.ts
|
|
@@ -10602,7 +10602,6 @@ 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
10606
|
if (stdout.trim()) {
|
|
10608
10607
|
const parsed = parseChannelsProbeOutput(stdout, { ignoreProbeFailed });
|
|
@@ -10610,6 +10609,7 @@ function runChannelsProbe(timeoutMs = 6e4, { ignoreProbeFailed = true } = {}) {
|
|
|
10610
10609
|
return {
|
|
10611
10610
|
available: true,
|
|
10612
10611
|
rawOutput: stdout.trim(),
|
|
10612
|
+
rawStderr: stderrText || void 0,
|
|
10613
10613
|
...parsed,
|
|
10614
10614
|
feishuConfigInvalid: parsed.feishuConfigInvalid || feishuConfigInvalidFromStderr
|
|
10615
10615
|
};
|
|
@@ -10620,6 +10620,7 @@ function runChannelsProbe(timeoutMs = 6e4, { ignoreProbeFailed = true } = {}) {
|
|
|
10620
10620
|
feishuConfigInvalid: stderrText.includes(FEISHU_INVALID_CONFIG_MSG),
|
|
10621
10621
|
accounts: [],
|
|
10622
10622
|
anyAccountWorking: false,
|
|
10623
|
+
rawStderr: stderrText || void 0,
|
|
10623
10624
|
error: execError ?? "no output from openclaw channels status --probe"
|
|
10624
10625
|
};
|
|
10625
10626
|
}
|
|
@@ -10719,7 +10720,7 @@ async function reportCliRun(opts) {
|
|
|
10719
10720
|
//#region src/help.ts
|
|
10720
10721
|
const BIN = "mclaw-diagnose";
|
|
10721
10722
|
function versionBanner() {
|
|
10722
|
-
return `v0.1.17
|
|
10723
|
+
return `v0.1.17`;
|
|
10723
10724
|
}
|
|
10724
10725
|
const COMMANDS = [
|
|
10725
10726
|
{
|
|
@@ -11257,12 +11258,28 @@ function planCtxPopulate(opts) {
|
|
|
11257
11258
|
//#endregion
|
|
11258
11259
|
//#region src/slardar/reporter.ts
|
|
11259
11260
|
let slardarInitialized = false;
|
|
11261
|
+
/**
|
|
11262
|
+
* 解析实际运行环境,映射到 Slardar 支持的 env 值。
|
|
11263
|
+
*
|
|
11264
|
+
* 仅处理 FORCE_FRAMEWORK_ENVIRONMENT(studio_server 在沙箱启动时注入):
|
|
11265
|
+
* boe / pre → "dev"(非生产环境,避免污染线上指标)
|
|
11266
|
+
* online → "online"
|
|
11267
|
+
* 未识别到有效值时返回 undefined,交由 openclaw-slardar 内部逻辑决定
|
|
11268
|
+
* (MIAODA_SLARDAR_ENV / 编译期常量 / 默认 online)。
|
|
11269
|
+
*/
|
|
11270
|
+
function resolveSlardarEnv() {
|
|
11271
|
+
const ffe = (process.env.FORCE_FRAMEWORK_ENVIRONMENT ?? "").trim().toLowerCase();
|
|
11272
|
+
if (ffe === "online") return "online";
|
|
11273
|
+
if (ffe === "boe" || ffe === "pre") return "dev";
|
|
11274
|
+
}
|
|
11260
11275
|
function initDiagnoseSlardar() {
|
|
11261
11276
|
if (slardarInitialized) return;
|
|
11262
11277
|
slardarInitialized = true;
|
|
11278
|
+
const env = resolveSlardarEnv();
|
|
11263
11279
|
initSlardar({
|
|
11264
11280
|
bid: "apaas_miaoda",
|
|
11265
|
-
release: getVersion()
|
|
11281
|
+
release: getVersion(),
|
|
11282
|
+
...env ? { env } : {}
|
|
11266
11283
|
});
|
|
11267
11284
|
process.on("beforeExit", flushDiagnoseSlardar);
|
|
11268
11285
|
}
|
|
@@ -11323,6 +11340,7 @@ function reportDoctorRunToSlardar(opts) {
|
|
|
11323
11340
|
* - validation_error:安装后校验失败信息(对应 UpgradeLarkResult.validationError)
|
|
11324
11341
|
* - error:命令级错误信息(对应 UpgradeLarkResult.error)
|
|
11325
11342
|
* - port_check_ok:端口存活检测结果(对应 UpgradeLarkResult.portCheckOk,未执行时为空)
|
|
11343
|
+
* - fix_status:场景专属修复状态(对应 UpgradeLarkResult.fixStatus,非场景命令时为空)
|
|
11326
11344
|
* - result:执行结果一行摘要(派生字段,见 buildUpgradeLarkResultSummary)
|
|
11327
11345
|
* - log_file:日志文件绝对路径(对应 UpgradeLarkResult.logFile)
|
|
11328
11346
|
*
|
|
@@ -11354,6 +11372,7 @@ function reportUpgradeLarkToSlardar(opts) {
|
|
|
11354
11372
|
validation_error: opts.validationError ?? "",
|
|
11355
11373
|
error: opts.error ?? "",
|
|
11356
11374
|
port_check_ok: String(opts.portCheckOk ?? ""),
|
|
11375
|
+
fix_status: opts.fixStatus ?? "",
|
|
11357
11376
|
result: opts.resultSummary,
|
|
11358
11377
|
log_file: opts.logFile
|
|
11359
11378
|
},
|
|
@@ -11510,6 +11529,7 @@ function probeChannels(label, log, timeoutMs) {
|
|
|
11510
11529
|
if (r.error) log(` ${label} error: ${r.error}`);
|
|
11511
11530
|
if (r.gatewayReachable != null) log(` ${label} gatewayReachable: ${r.gatewayReachable}`);
|
|
11512
11531
|
for (const acct of r.accounts ?? []) log(` ${label} account ${acct.id}: isWorking=${acct.isWorking} bits=[${acct.bits.join(",")}]`);
|
|
11532
|
+
if (r.rawStderr) log(` ${label} stderr:\n${r.rawStderr}`);
|
|
11513
11533
|
if (r.rawOutput) log(` ${label} raw output:\n${r.rawOutput}`);
|
|
11514
11534
|
return r;
|
|
11515
11535
|
} catch (e) {
|
|
@@ -12507,6 +12527,7 @@ async function main() {
|
|
|
12507
12527
|
resultStatus: "failed",
|
|
12508
12528
|
error: upgradeLockErr,
|
|
12509
12529
|
logFile: "",
|
|
12530
|
+
fixStatus,
|
|
12510
12531
|
resultSummary: buildUpgradeLarkResultSummary(failResult, checkOnly)
|
|
12511
12532
|
});
|
|
12512
12533
|
node_process.default.exitCode = 1;
|
|
@@ -12536,6 +12557,7 @@ async function main() {
|
|
|
12536
12557
|
validationError: result.validationError,
|
|
12537
12558
|
error: result.error,
|
|
12538
12559
|
portCheckOk: result.portCheckOk,
|
|
12560
|
+
fixStatus: result.fixStatus,
|
|
12539
12561
|
timing: result.timing
|
|
12540
12562
|
});
|
|
12541
12563
|
try {
|
|
@@ -12598,6 +12620,7 @@ main().catch((err) => {
|
|
|
12598
12620
|
resultStatus: "failed",
|
|
12599
12621
|
error: msg,
|
|
12600
12622
|
logFile: "",
|
|
12623
|
+
fixStatus,
|
|
12601
12624
|
resultSummary: buildUpgradeLarkResultSummary(failResult, checkOnly)
|
|
12602
12625
|
});
|
|
12603
12626
|
} else if ([
|