openclaw-channels-csdn-setup 0.2.9 → 0.2.11

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/cli.cjs +13 -4
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -42,11 +42,17 @@ function mergeCsdnIntoOpenClawConfig(existing, csdn) {
42
42
  const channels = isPlainObject(prevChannels) ? { ...prevChannels } : {};
43
43
  const prevCsdn = channels[CSDN_IM_CHANNEL_KEY];
44
44
  const prevCsdnObj = isPlainObject(prevCsdn) ? prevCsdn : {};
45
- channels[CSDN_IM_CHANNEL_KEY] = {
46
- ...prevCsdnObj,
47
- ...csdn
48
- };
45
+ channels[CSDN_IM_CHANNEL_KEY] = { ...prevCsdnObj, ...csdn };
49
46
  base.channels = channels;
47
+ const prevPlugins = base.plugins;
48
+ const plugins = isPlainObject(prevPlugins) ? { ...prevPlugins } : {};
49
+ const prevAllow = plugins.allow;
50
+ const allowArr = Array.isArray(prevAllow) ? [...prevAllow] : [];
51
+ if (!allowArr.includes(CSDN_IM_CHANNEL_KEY)) {
52
+ allowArr.push(CSDN_IM_CHANNEL_KEY);
53
+ }
54
+ plugins.allow = allowArr;
55
+ base.plugins = plugins;
50
56
  return base;
51
57
  }
52
58
 
@@ -74,6 +80,9 @@ function stripChannelFromConfig(cfg, channelId) {
74
80
  delete installs[channelId];
75
81
  plugins.installs = installs;
76
82
  }
83
+ if (Array.isArray(plugins.allow)) {
84
+ plugins.allow = plugins.allow.filter((id) => id !== channelId);
85
+ }
77
86
  return { ...cfg, channels, plugins };
78
87
  }
79
88
  function defaultConfigPath() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-channels-csdn-setup",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "One-shot installer: openclaw plugins install csdn-im@latest + merge channels.csdn-im into openclaw.json. Requires OpenClaw peer range as published in csdn-im (see csdn-im package.json openclaw.compatibility).",
5
5
  "type": "module",
6
6
  "license": "MIT",