@wecode-ai/weibo-openclaw-plugin 1.0.8-beta.9 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wecode-ai/weibo-openclaw-plugin",
3
- "version": "1.0.8-beta.9",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "OpenClaw Weibo DM channel plugin",
6
6
  "license": "MIT",
@@ -54,7 +54,7 @@ const __dirname = path.dirname(__filename);
54
54
  // 配置常量
55
55
  // ============================================================================
56
56
 
57
- const BASE_URL = 'https://dm-test.api.weibo.com';
57
+ const BASE_URL = 'https://open-im.api.weibo.com';
58
58
 
59
59
  const CONFIG_PATHS = {
60
60
  openclaw: path.join(os.homedir(), '.openclaw', 'openclaw.json'),
@@ -243,10 +243,15 @@ async function saveLocalConfig(config) {
243
243
  }
244
244
 
245
245
  await fs.mkdir(path.dirname(CONFIG_PATHS.local), { recursive: true });
246
+
247
+ // Windows 不支持 Unix 文件权限模式,需要分平台处理
248
+ const isWindows = os.platform() === 'win32';
249
+ const writeOptions = isWindows ? {} : { mode: 0o600 };
250
+
246
251
  await fs.writeFile(
247
252
  CONFIG_PATHS.local,
248
253
  JSON.stringify(encryptedConfig, null, 2),
249
- { mode: 0o600 } // 设置文件权限为 600(仅所有者可读写)
254
+ writeOptions
250
255
  );
251
256
  }
252
257
 
@@ -332,10 +337,15 @@ class TokenManager {
332
337
  */
333
338
  async saveTokenCache() {
334
339
  await fs.mkdir(path.dirname(CONFIG_PATHS.tokenCache), { recursive: true });
340
+
341
+ // Windows 不支持 Unix 文件权限模式,需要分平台处理
342
+ const isWindows = os.platform() === 'win32';
343
+ const writeOptions = isWindows ? {} : { mode: 0o600 };
344
+
335
345
  await fs.writeFile(
336
346
  CONFIG_PATHS.tokenCache,
337
347
  JSON.stringify(this.tokenCache, null, 2),
338
- { mode: 0o600 }
348
+ writeOptions
339
349
  );
340
350
  }
341
351