@lark-apaas/openclaw-scripts-diagnose-cli 0.1.18 → 0.1.19
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 +29 -6
- 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.19";
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region src/rule-engine/base.ts
|
|
@@ -4302,8 +4302,14 @@ CleanupInstallBackupDirsRule = __decorate([Rule({
|
|
|
4302
4302
|
})], CleanupInstallBackupDirsRule);
|
|
4303
4303
|
//#endregion
|
|
4304
4304
|
//#region src/rules/lark-cli-missing-for-installed-lark-plugin.ts
|
|
4305
|
-
/**
|
|
4305
|
+
/** 触发本规则的特定 fork 飞书插件版本(仅用于 isTargetForkPlugin 检测,不作安装 tag)。 */
|
|
4306
4306
|
const TARGET_VERSION = "2026.4.4";
|
|
4307
|
+
/**
|
|
4308
|
+
* 缺省安装 tag:当 ctx 未携带 recommendedOpenclawTag 时,install-cli 用它拉 OSS manifest。
|
|
4309
|
+
* 必须是有效的 openclaw 推荐版本(manifest 以 openclaw 版本为 key),不能用 fork 插件版本
|
|
4310
|
+
* (如 2026.4.4 不是 openclaw manifest tag,会导致 fetchManifest 报 "manifest signed URL missing")。
|
|
4311
|
+
*/
|
|
4312
|
+
const FALLBACK_OPENCLAW_TAG = "2026.4.11";
|
|
4307
4313
|
function readInstalledLarkPlugin(ctx) {
|
|
4308
4314
|
const pkgPath = node_path.default.join(getExtensionsDir(ctx.configPath), LARK_PLUGIN_NAME, "package.json");
|
|
4309
4315
|
if (!node_fs.default.existsSync(pkgPath)) return null;
|
|
@@ -4382,7 +4388,9 @@ let LarkCliMissingForInstalledLarkPluginRule = class LarkCliMissingForInstalledL
|
|
|
4382
4388
|
repair(ctx) {
|
|
4383
4389
|
if (!isTargetForkPlugin(readInstalledLarkPlugin(ctx))) return;
|
|
4384
4390
|
if (isLarkCliAvailable()) return;
|
|
4385
|
-
|
|
4391
|
+
const tag = ctx.vars.recommendedOpenclawTag || FALLBACK_OPENCLAW_TAG;
|
|
4392
|
+
console.error(`[lark-cli-missing] installing lark-cli via 'install-cli ${tag} --cli=lark-cli'`);
|
|
4393
|
+
installLarkCliOnce(tag);
|
|
4386
4394
|
}
|
|
4387
4395
|
};
|
|
4388
4396
|
LarkCliMissingForInstalledLarkPluginRule = __decorate([Rule({
|
|
@@ -11244,7 +11252,7 @@ async function reportCliRun(opts) {
|
|
|
11244
11252
|
//#region src/help.ts
|
|
11245
11253
|
const BIN = "mclaw-diagnose";
|
|
11246
11254
|
function versionBanner() {
|
|
11247
|
-
return `v0.1.
|
|
11255
|
+
return `v0.1.19`;
|
|
11248
11256
|
}
|
|
11249
11257
|
const COMMANDS = [
|
|
11250
11258
|
{
|
|
@@ -12437,6 +12445,21 @@ const mode = args.find((a) => !a.startsWith("-"));
|
|
|
12437
12445
|
const t0 = Date.now();
|
|
12438
12446
|
const scene = getFlag(args, "scene");
|
|
12439
12447
|
/**
|
|
12448
|
+
* Decode `--ctx=<base64>` into an opaque JSON object. Returns undefined when
|
|
12449
|
+
* the flag isn't present — the caller decides whether to fall back to the
|
|
12450
|
+
* innerapi or to error out.
|
|
12451
|
+
*
|
|
12452
|
+
* The object's shape is not enforced here; downstream code consumes it via
|
|
12453
|
+
* either `normalizeCtx()` (new path) or direct field access for the legacy
|
|
12454
|
+
* check/repair/reset contract still used by sandbox_console push.
|
|
12455
|
+
*/
|
|
12456
|
+
function parseCtxFlag(args) {
|
|
12457
|
+
const ctxArg = args.find((a) => a.startsWith("--ctx="));
|
|
12458
|
+
if (!ctxArg) return void 0;
|
|
12459
|
+
const b64 = ctxArg.slice(6);
|
|
12460
|
+
return JSON.parse(Buffer.from(b64, "base64").toString("utf-8"));
|
|
12461
|
+
}
|
|
12462
|
+
/**
|
|
12440
12463
|
* Pull the first non-flag positional after the mode name.
|
|
12441
12464
|
* (The mode itself is args[0] in the filtered set, so we skip index 0.)
|
|
12442
12465
|
*/
|
|
@@ -12527,7 +12550,7 @@ async function main() {
|
|
|
12527
12550
|
console.error(`${mode}: begin argv=[${args.join(" ")}] version=${getVersion()} traceId=${traceId ?? "-"} caller=${caller ?? "-"} runIdGenerated=${rc.generated}`);
|
|
12528
12551
|
switch (mode) {
|
|
12529
12552
|
case "check": {
|
|
12530
|
-
const raw = await fetchCtxViaInnerApi({
|
|
12553
|
+
const raw = parseCtxFlag(args) ?? await fetchCtxViaInnerApi({
|
|
12531
12554
|
populate: planCtxPopulate({
|
|
12532
12555
|
command: "check",
|
|
12533
12556
|
profile
|
|
@@ -12552,7 +12575,7 @@ async function main() {
|
|
|
12552
12575
|
break;
|
|
12553
12576
|
}
|
|
12554
12577
|
case "repair": {
|
|
12555
|
-
const raw = await fetchCtxViaInnerApi({
|
|
12578
|
+
const raw = parseCtxFlag(args) ?? await fetchCtxViaInnerApi({
|
|
12556
12579
|
populate: planCtxPopulate({
|
|
12557
12580
|
command: "repair",
|
|
12558
12581
|
profile
|