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.
- package/package.json +1 -1
- package/server.js +8 -11
package/package.json
CHANGED
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
|
-
|
|
2418
|
-
|
|
2419
|
-
const
|
|
2420
|
-
if (
|
|
2421
|
-
//
|
|
2422
|
-
|
|
2423
|
-
|
|
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
|
|