MCPcopy Create free account
hub / github.com/echoVic/blade-code / saveConversation

Method saveConversation

src/context/storage/PersistentStore.ts:62–73  ·  view source on GitHub ↗

* 保存对话上下文

(sessionId: string, conversation: ConversationContext)

Source from the content-addressed store, hash-verified

60 * 保存对话上下文
61 */
62 async saveConversation(sessionId: string, conversation: ConversationContext): Promise<void> {
63 try {
64 const conversationPath = path.join(this.storagePath, 'conversations', `${sessionId}.json`);
65 const data = {
66 ...conversation,
67 lastSaved: Date.now(),
68 };
69 await fs.writeFile(conversationPath, JSON.stringify(data, null, 2), 'utf-8');
70 } catch (error) {
71 console.warn(`警告:无法保存对话 ${sessionId}:`, error);
72 }
73 }
74
75 /**
76 * 加载对话上下文

Callers 1

saveContextMethod · 0.95

Calls 1

warnMethod · 0.45

Tested by

no test coverage detected