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

Method cacheMessageSummary

src/context/storage/CacheStore.ts:115–126  ·  view source on GitHub ↗

* 缓存消息摘要

(sessionId: string, messages: ContextMessage[], summary: string)

Source from the content-addressed store, hash-verified

113 * 缓存消息摘要
114 */
115 cacheMessageSummary(sessionId: string, messages: ContextMessage[], summary: string): void {
116 const key = `summary:${sessionId}:${messages.length}`;
117 this.set(
118 key,
119 {
120 summary,
121 messageCount: messages.length,
122 lastMessage: messages[messages.length - 1]?.timestamp || 0,
123 },
124 10 * 60 * 1000
125 ); // 10分钟TTL
126 }
127
128 /**
129 * 获取缓存的消息摘要

Callers

nothing calls this directly

Calls 1

setMethod · 0.95

Tested by

no test coverage detected