chaimi-keep-mcp 3.5.0-beta.5 → 3.5.0-beta.6

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/package.json +1 -1
  2. package/server.js +8 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chaimi-keep-mcp",
3
- "version": "3.5.0-beta.5",
3
+ "version": "3.5.0-beta.6",
4
4
  "description": "柴米AI记账 MCP Server - 支持 Claude、Cursor、OpenClaw、WorkBuddy 等 AI 工具直接记账",
5
5
  "main": "server.js",
6
6
  "bin": {
package/server.js CHANGED
@@ -2413,17 +2413,14 @@ async function getAgentName() {
2413
2413
  if (oauthManager && oauthManager.tokenStorage) {
2414
2414
  const localName = await oauthManager.tokenStorage.loadAgentName();
2415
2415
 
2416
- // 如果是默认名称,尝试从云端获取
2417
- if (localName === '柴米AI助手') {
2418
- // 获取保存的 deviceCode
2419
- const deviceCode = await oauthManager.tokenStorage.loadDeviceCode();
2420
- if (deviceCode) {
2421
- // 从云端获取
2422
- const cloudName = await fetchAgentNameFromCloud(deviceCode);
2423
- if (cloudName && cloudName !== '柴米AI助手') {
2424
- await oauthManager.tokenStorage.saveAgentName(cloudName);
2425
- return cloudName;
2426
- }
2416
+ // 尝试从云端获取,看看是否有更新
2417
+ const deviceCode = await oauthManager.tokenStorage.loadDeviceCode();
2418
+ if (deviceCode) {
2419
+ const cloudName = await fetchAgentNameFromCloud(deviceCode);
2420
+ if (cloudName && cloudName !== localName) {
2421
+ // 云端有更新,同步到本地
2422
+ await oauthManager.tokenStorage.saveAgentName(cloudName);
2423
+ return cloudName;
2427
2424
  }
2428
2425
  }
2429
2426