MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / saveMessages

Method saveMessages

src/app/repo/agent_chat.ts:103–106  ·  view source on GitHub ↗
(conversationId: string, messages: ChatMessage[])

Source from the content-addressed store, hash-verified

101
102 // 保存整个消息列表(用于批量更新)
103 async saveMessages(conversationId: string, messages: ChatMessage[]): Promise<void> {
104 const messagesDir = await this.getChildDir(MESSAGES_DIR);
105 await this.writeJsonFile(`${conversationId}.json`, messages, messagesDir);
106 }
107
108 // ---- 附件存储 ----
109 // 新路径: agents/workspace/uploads/{id}(LLM 可通过 opfs_read 访问)

Callers 7

deleteMessagesFunction · 0.80
clearMessagesFunction · 0.80
callLLMWithToolLoopMethod · 0.80
handleConversationMethod · 0.80
handleCompactChatMethod · 0.80
autoCompactMethod · 0.80
agent_chat.test.tsFile · 0.80

Calls 2

getChildDirMethod · 0.80
writeJsonFileMethod · 0.80

Tested by

no test coverage detected