@lanmers/wecom-openclaw-plugin-agents 3.0.0 → 4.0.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.
package/dist/index.cjs.js CHANGED
@@ -2368,11 +2368,11 @@ const dmPolicy = {
2368
2368
  return account?.config.dmPolicy ?? "open";
2369
2369
  },
2370
2370
  setPolicy: (cfg, policy, accountId) => {
2371
- const channelId = accountId ? makeChannelId(accountId) : CHANNEL_ID;
2371
+ const channelId = (accountId ?? null) ? makeChannelId(accountId) : CHANNEL_ID;
2372
2372
  return setWeComDmPolicy(cfg, channelId, policy);
2373
2373
  },
2374
2374
  promptAllowFrom: async ({ cfg, prompter, accountId }) => {
2375
- const channelId = accountId ? makeChannelId(accountId) : CHANNEL_ID;
2375
+ const channelId = (accountId ?? null) ? makeChannelId(accountId) : CHANNEL_ID;
2376
2376
  const account = resolveWeComAccountByChannelId(cfg, channelId);
2377
2377
  if (!account) {
2378
2378
  return cfg;
@@ -2414,7 +2414,7 @@ const wecomOnboardingAdapter = {
2414
2414
  },
2415
2415
  configure: async ({ cfg, prompter, forceAllowFrom, accountId }) => {
2416
2416
  // 如果指定了 accountId,则使用该 Agent;否则创建新 Agent
2417
- let targetAccountId = accountId;
2417
+ let targetAccountId = accountId ?? undefined;
2418
2418
  const channelIds = listWeComChannelIds(cfg);
2419
2419
  const existingNames = channelIds.map(id => {
2420
2420
  // 提取账户名(wecom-bot1 -> bot1)