@lark-apaas/openclaw-scripts-diagnose-cli 0.1.14-alpha.10 → 0.1.14-alpha.12
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 +18 -9
- 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.14-alpha.
|
|
55
|
+
return "0.1.14-alpha.12";
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/rule-engine/base.ts
|
|
@@ -3550,8 +3550,13 @@ const CHANNEL_LINE_RE = /^-\s+Feishu\s+([^:]+):\s+(.+)$/;
|
|
|
3550
3550
|
*
|
|
3551
3551
|
* Strips colon-prefixed key:value bits (dm:, bot:, in:, out:, token:, allow:,
|
|
3552
3552
|
* intents:, groups:, health:) and evaluates the canonical health formula.
|
|
3553
|
+
*
|
|
3554
|
+
* @param ignoreProbeFailed When true, "probe failed" is not treated as a
|
|
3555
|
+
* failure condition. Use this when checking whether channels are structurally
|
|
3556
|
+
* working for upgrade-gate purposes (probe failures indicate network issues,
|
|
3557
|
+
* not plugin misconfiguration).
|
|
3553
3558
|
*/
|
|
3554
|
-
function accountIsWorking(bits) {
|
|
3559
|
+
function accountIsWorking(bits, ignoreProbeFailed = true) {
|
|
3555
3560
|
const bitTokens = /* @__PURE__ */ new Set();
|
|
3556
3561
|
let hasError = false;
|
|
3557
3562
|
let hasProbeFailed = false;
|
|
@@ -3570,14 +3575,14 @@ function accountIsWorking(bits) {
|
|
|
3570
3575
|
}
|
|
3571
3576
|
if (!bitTokens.has("enabled") || !bitTokens.has("configured")) return false;
|
|
3572
3577
|
if (bitTokens.has("works")) return true;
|
|
3573
|
-
if (bitTokens.has("running") && !hasError && !hasProbeFailed) return true;
|
|
3578
|
+
if (bitTokens.has("running") && !hasError && (ignoreProbeFailed || !hasProbeFailed)) return true;
|
|
3574
3579
|
return false;
|
|
3575
3580
|
}
|
|
3576
3581
|
/**
|
|
3577
3582
|
* Parse the raw stdout of `openclaw channels status --probe`.
|
|
3578
3583
|
* Port of Python `extract_channels_probe` from the feishu-channel-success-rate skill.
|
|
3579
3584
|
*/
|
|
3580
|
-
function parseChannelsProbeOutput(text) {
|
|
3585
|
+
function parseChannelsProbeOutput(text, { ignoreProbeFailed = true } = {}) {
|
|
3581
3586
|
const gatewayReachable = text.includes("Gateway reachable");
|
|
3582
3587
|
const feishuConfigInvalid = text.includes(FEISHU_INVALID_CONFIG_MSG);
|
|
3583
3588
|
const accounts = [];
|
|
@@ -3587,7 +3592,7 @@ function parseChannelsProbeOutput(text) {
|
|
|
3587
3592
|
if (!m) continue;
|
|
3588
3593
|
const [, acct, rest] = m;
|
|
3589
3594
|
const bits = rest.split(",").map((b) => b.trim());
|
|
3590
|
-
const isWorking = accountIsWorking(bits);
|
|
3595
|
+
const isWorking = accountIsWorking(bits, ignoreProbeFailed);
|
|
3591
3596
|
if (isWorking) anyAccountWorking = true;
|
|
3592
3597
|
accounts.push({
|
|
3593
3598
|
id: acct.trim(),
|
|
@@ -3611,10 +3616,13 @@ function parseChannelsProbeOutput(text) {
|
|
|
3611
3616
|
* process exits with a non-zero code, falling back to an unavailable result
|
|
3612
3617
|
* only when there is genuinely no output to parse.
|
|
3613
3618
|
*
|
|
3614
|
-
* @param timeoutMs
|
|
3619
|
+
* @param timeoutMs Maximum wait time. Default is 60 s because v2026.4.x
|
|
3615
3620
|
* lacks a per-request HTTP timeout and can block indefinitely.
|
|
3621
|
+
* @param ignoreProbeFailed When true, accounts with "probe failed" are still
|
|
3622
|
+
* counted as working. Pass true for upgrade-gate checks where probe failures
|
|
3623
|
+
* reflect network conditions rather than plugin misconfiguration.
|
|
3616
3624
|
*/
|
|
3617
|
-
function runChannelsProbe(timeoutMs = 6e4) {
|
|
3625
|
+
function runChannelsProbe(timeoutMs = 6e4, { ignoreProbeFailed = true } = {}) {
|
|
3618
3626
|
let stdout = "";
|
|
3619
3627
|
let stderrText = "";
|
|
3620
3628
|
let execError;
|
|
@@ -3639,7 +3647,7 @@ function runChannelsProbe(timeoutMs = 6e4) {
|
|
|
3639
3647
|
}
|
|
3640
3648
|
if (stdout.trim()) return {
|
|
3641
3649
|
available: true,
|
|
3642
|
-
...parseChannelsProbeOutput(stdout)
|
|
3650
|
+
...parseChannelsProbeOutput(stdout, { ignoreProbeFailed })
|
|
3643
3651
|
};
|
|
3644
3652
|
return {
|
|
3645
3653
|
available: false,
|
|
@@ -3701,6 +3709,7 @@ let UpgradeLarkNeededRule = class UpgradeLarkNeededRule extends DiagnoseRule {
|
|
|
3701
3709
|
UpgradeLarkNeededRule = __decorate([Rule({
|
|
3702
3710
|
key: "upgrade_lark_needed",
|
|
3703
3711
|
description: "检测飞书插件版本不兼容且 channels 不可用,判断是否需要执行 upgrade-lark 升级",
|
|
3712
|
+
dependsOn: ["config_syntax_check"],
|
|
3704
3713
|
repairMode: "check-only",
|
|
3705
3714
|
level: "silent",
|
|
3706
3715
|
profile: "experimental",
|
|
@@ -10404,7 +10413,7 @@ async function reportCliRun(opts) {
|
|
|
10404
10413
|
//#region src/help.ts
|
|
10405
10414
|
const BIN = "mclaw-diagnose";
|
|
10406
10415
|
function versionBanner() {
|
|
10407
|
-
return `v0.1.14-alpha.
|
|
10416
|
+
return `v0.1.14-alpha.12`;
|
|
10408
10417
|
}
|
|
10409
10418
|
const COMMANDS = [
|
|
10410
10419
|
{
|
package/package.json
CHANGED