MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / topicHistory

Function topicHistory

graph-ui/src/browser-ai/chat-context.ts:29–31  ·  view source on GitHub ↗
(turns: readonly T[], topic: ChatTopic | undefined)

Source from the content-addressed store, hash-verified

27 * Coming back started fresh, so "Und was noch?" got "Ja, und noch." (B4). Replies without a
28 * topic (no context) belong to none. */
29export function topicHistory<T extends BrowserChatTurn>(turns: readonly T[], topic: ChatTopic | undefined): T[] {
30 return topic ? turns.filter(turn => turn.topic?.key === topic.key) : [];
31}
32
33/** The divider above turn `index`: "new" for the first turn about another topic, "back" for
34 * a topic that has earlier turns, nothing within a topic (B4). */

Callers 3

sendFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected