(snapshot)
| 3594 | } |
| 3595 | |
| 3596 | function formatUnifiedMemoryForIMessage(snapshot) { |
| 3597 | const lines = []; |
| 3598 | if (snapshot.latestHandoff?.summary) { |
| 3599 | lines.push(`最近交接:${snapshot.latestHandoff.summary}`); |
| 3600 | } |
| 3601 | const stateParts = formatUnifiedMemoryStateParts(snapshot.currentState); |
| 3602 | if (stateParts.length) lines.push(`近期状态:${stateParts.join(";")}`); |
| 3603 | for (const entry of snapshot.entries || []) { |
| 3604 | lines.push(`${entry.summary}`); |
| 3605 | } |
| 3606 | if (!lines.length) return "统一记忆现在还是空的。"; |
| 3607 | return [`统一记忆:`, ...[...new Set(lines)].slice(0, 8)].join("\n"); |
| 3608 | } |
| 3609 | |
| 3610 | function formatUnifiedMemoryStatus(status) { |
| 3611 | const counts = status.counts || {}; |
no test coverage detected