@lark-apaas/openclaw-scripts-diagnose-cli 0.1.3 → 0.1.4-alpha.0

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.
Files changed (2) hide show
  1. package/dist/index.cjs +20 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -717,6 +717,13 @@ FeishuChannelRule = __decorate([Rule({
717
717
  * detects + fixes drift on the main bot's appId/appSecret. Single-agent
718
718
  * configs (no `accounts`) are out of scope — handled by `feishu_channel`.
719
719
  */
720
+ /** Top-level `channels.feishu.*` account-policy fields migrated into the main bot. */
721
+ const TOP_FIELDS_TO_MIGRATE = [
722
+ "dmPolicy",
723
+ "allowFrom",
724
+ "groupPolicy",
725
+ "groupAllowFrom"
726
+ ];
720
727
  let FeishuDefaultAccountRule = class FeishuDefaultAccountRule extends DiagnoseRule {
721
728
  validate(ctx) {
722
729
  const feishu = getNestedMap(ctx.config, "channels", "feishu");
@@ -763,10 +770,18 @@ let FeishuDefaultAccountRule = class FeishuDefaultAccountRule extends DiagnoseRu
763
770
  const merged = {
764
771
  ...existingBot,
765
772
  ...defaultAccount,
766
- ...defaultAcc,
767
- appId: effectiveAppId,
768
- appSecret: DEFAULT_FEISHU_APP_SECRET
773
+ ...defaultAcc
774
+ };
775
+ for (const k of TOP_FIELDS_TO_MIGRATE) if (merged[k] === void 0 && feishu[k] !== void 0) merged[k] = feishu[k];
776
+ const accountGroups = asRecord(merged.groups) ?? {};
777
+ const topGroups = asRecord(feishu.groups) ?? {};
778
+ const fusedGroups = {
779
+ ...accountGroups,
780
+ ...topGroups
769
781
  };
782
+ if (Object.keys(fusedGroups).length > 0) merged.groups = fusedGroups;
783
+ merged.appId = effectiveAppId;
784
+ merged.appSecret = DEFAULT_FEISHU_APP_SECRET;
770
785
  const chatID = ctx.vars?.teamChatID;
771
786
  if (typeof chatID === "string" && chatID !== "") {
772
787
  const existingGroups = asRecord(merged.groups) ?? {};
@@ -780,6 +795,7 @@ let FeishuDefaultAccountRule = class FeishuDefaultAccountRule extends DiagnoseRu
780
795
  delete accounts.default;
781
796
  delete feishu.appId;
782
797
  delete feishu.appSecret;
798
+ for (const k of TOP_FIELDS_TO_MIGRATE) delete feishu[k];
783
799
  this.rewireBindings(ctx.config, expectedKey);
784
800
  }
785
801
  enforceMainBotValues(ctx, accounts) {
@@ -2795,7 +2811,7 @@ async function runDoctor(rawCtx, opts) {
2795
2811
  //#region src/help.ts
2796
2812
  const BIN = "mclaw-diagnose";
2797
2813
  function versionBanner() {
2798
- return `v0.1.3`;
2814
+ return `v0.1.4-alpha.0`;
2799
2815
  }
2800
2816
  const COMMANDS = [
2801
2817
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/openclaw-scripts-diagnose-cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4-alpha.0",
4
4
  "description": "CLI for OpenClaw config diagnose and repair with JSON5 support",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {