MCPcopy
hub / github.com/coder/mux / appendUserHistoryMessage

Function appendUserHistoryMessage

src/node/services/workspaceGoalService.test.ts:41–52  ·  view source on GitHub ↗
(
  historyService: HistoryService,
  workspaceId: string,
  text: string,
  metadata: Parameters<typeof createMuxMessage>[3] = { timestamp: Date.now() }
)

Source from the content-addressed store, hash-verified

39}
40
41async function appendUserHistoryMessage(
42 historyService: HistoryService,
43 workspaceId: string,
44 text: string,
45 metadata: Parameters<typeof createMuxMessage>[3] = { timestamp: Date.now() }
46): Promise<void> {
47 const result = await historyService.appendToHistory(
48 workspaceId,
49 createMuxMessage(`goal-test-user-${crypto.randomUUID()}`, "user", text, metadata)
50 );
51 expect(result.success).toBe(true);
52}
53
54async function getLastUserHistoryMessage(historyService: HistoryService, workspaceId: string) {
55 const history = await historyService.getLastMessages(workspaceId, 20);

Callers 1

Calls 2

createMuxMessageFunction · 0.90
appendToHistoryMethod · 0.80

Tested by

no test coverage detected