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

Method appendMessage

src/app/repo/agent_chat.ts:84–89  ·  view source on GitHub ↗
(message: ChatMessage)

Source from the content-addressed store, hash-verified

82
83 // 追加消息
84 async appendMessage(message: ChatMessage): Promise<void> {
85 const messagesDir = await this.getChildDir(MESSAGES_DIR);
86 const messages = await this.readJsonFile<ChatMessage[]>(`${message.conversationId}.json`, [], messagesDir);
87 messages.push(message);
88 await this.writeJsonFile(`${message.conversationId}.json`, messages, messagesDir);
89 }
90
91 // 更新消息(按 id 匹配)
92 async updateMessage(message: ChatMessage): Promise<void> {

Callers 4

callLLMWithToolLoopMethod · 0.80
executeInternalTaskMethod · 0.80

Calls 3

getChildDirMethod · 0.80
pushMethod · 0.80
writeJsonFileMethod · 0.80

Tested by

no test coverage detected