chaimi-keep-mcp 3.5.0-beta.0 → 3.5.0-beta.2
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/oauth.js +5 -1
- package/package.json +1 -1
- package/server.js +5 -5
package/oauth.js
CHANGED
|
@@ -505,7 +505,11 @@ class FileTokenStorage extends TokenStorage {
|
|
|
505
505
|
agentName: agentName || '柴米AI助手',
|
|
506
506
|
updatedAt: new Date().toISOString()
|
|
507
507
|
};
|
|
508
|
-
|
|
508
|
+
// 使用 JSON.stringify 并转义处理,确保中文正常显示(不转义为 \uXXXX)
|
|
509
|
+
const jsonStr = JSON.stringify(data, null, 2)
|
|
510
|
+
.replace(/\\u[\dA-F]{4}/gi, (match) =>
|
|
511
|
+
String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16)));
|
|
512
|
+
await this.fs.writeFile(agentNamePath, jsonStr, 'utf8');
|
|
509
513
|
console.error('✅ Agent 名称已保存:', agentNamePath);
|
|
510
514
|
} catch (err) {
|
|
511
515
|
console.error('❌ 保存 Agent 名称失败:', err.message);
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -152,9 +152,9 @@ const ENV = process.env.NODE_ENV || 'production';
|
|
|
152
152
|
// 加密的云函数 URL(开发和生产环境分开)
|
|
153
153
|
const ENCRYPTED_URLS = {
|
|
154
154
|
development: {
|
|
155
|
-
hub: '',
|
|
156
|
-
oauth: '',
|
|
157
|
-
prompt: ''
|
|
155
|
+
hub: 'enc:v2:d397243fce051c611175302dea8a7a54:8f0bc1dc6966e9149e8d3ecae2467830:cf61c7a159154d15aa1502deec2519931090ff791be67e89fd4e3b20322b2bea8071be02d768ec10abdc50b2d3e76df6dc44a6d46d61c2743acdef428205cc0e3534c93d94857cc91985db5fd69745053df05a87',
|
|
156
|
+
oauth: 'enc:v2:bff470f73af1723d6e320d39df72b342:eefb409dff5a4713931caa3886f9159c:18d0a711f31a5ba7e068e43d8bcce6b8fc56513d44ff3d90ab006063461b44025387e52cb2ce5ffe471a8a8f4b993879dcaa485dd1e845c647be134595467c4a00efc736d15abfcaa8d8cf460365fbf597e0',
|
|
157
|
+
prompt: 'enc:v2:a058c504374087a36417280f0bc4288d:ed5fc65a697c1254e8aeb9faa7119ec8:b8831fd319c35bc01554546827ce31bd04d2039fb87f0b6a19b35850ec228b6988b2103b1cc45a7bd21b117b299c5095a44e1ee4a4c2adb04e24a401e1271aff912503e2abb9cec03764b774df53e60b0686d3'
|
|
158
158
|
},
|
|
159
159
|
production: {
|
|
160
160
|
hub: 'enc:v2:500682dfbd51aff69852abe39430da35:3d57b5ac7f798c6770209159b6dfd9fb:7b9733f27208809b761090f7628f3799aac12c957cdd45b3d512eb4f1f1c18f626afd0b73b12982500122b11e373e0a2a71f14cb6c5966cf98af9ae4b9e79fb575d1e2f42ec403690d5c7dcc519e9eaec21865eb',
|
|
@@ -195,14 +195,14 @@ let tokenEncryptionKey;
|
|
|
195
195
|
// 初始化配置
|
|
196
196
|
async function initConfig() {
|
|
197
197
|
// 获取 URL 加密密钥
|
|
198
|
-
const urlEncryptKey = process.env.URL_ENCRYPT_KEY || '
|
|
198
|
+
const urlEncryptKey = process.env.URL_ENCRYPT_KEY || 'd2e4168144a50c6d8d0c4692cd73331eb2bc1db0cd727afaf29ff9645d480e59';
|
|
199
199
|
|
|
200
200
|
// 获取 Token 加密密钥
|
|
201
201
|
tokenEncryptionKey = getOrCreateSecretKey();
|
|
202
202
|
|
|
203
203
|
// 获取 API 密钥
|
|
204
204
|
if (!CHAIMI_API_SECRET) {
|
|
205
|
-
CHAIMI_API_SECRET = process.env.CHAIMI_API_SECRET || '
|
|
205
|
+
CHAIMI_API_SECRET = process.env.CHAIMI_API_SECRET || '040f513aa8f0688b4fa151865ee7515dac707f9649f48ec13c953a5e7dca0cad';
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// 配置 URL
|