MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / createMessage

Function createMessage

cli/src/utils/__tests__/collapse-helpers.test.ts:19–31  ·  view source on GitHub ↗
(
  id: string,
  variant: 'ai' | 'user' | 'agent' | 'error' = 'ai',
  blocks?: ContentBlock[],
  metadata?: { isCollapsed?: boolean; userOpened?: boolean },
)

Source from the content-addressed store, hash-verified

17
18// Helper to create minimal test messages
19const createMessage = (
20 id: string,
21 variant: 'ai' | 'user' | 'agent' | 'error' = 'ai',
22 blocks?: ContentBlock[],
23 metadata?: { isCollapsed?: boolean; userOpened?: boolean },
24): ChatMessage => ({
25 id,
26 variant,
27 content: '',
28 timestamp: new Date().toISOString(),
29 blocks,
30 metadata,
31})
32
33// Helper to create tool blocks
34const createToolBlock = (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected