MCPcopy Create free account
hub / github.com/anomalyco/opencode / formatTranscript

Function formatTranscript

packages/tui/src/util/transcript.ts:26–44  ·  view source on GitHub ↗
(
  session: SessionInfo,
  messages: MessageWithParts[],
  options: TranscriptOptions,
)

Source from the content-addressed store, hash-verified

24}
25
26export function formatTranscript(
27 session: SessionInfo,
28 messages: MessageWithParts[],
29 options: TranscriptOptions,
30): string {
31 const providers = Model.index(options.providers)
32 let transcript = `# ${session.title}\n\n`
33 transcript += `**Session ID:** ${session.id}\n`
34 transcript += `**Created:** ${new Date(session.time.created).toLocaleString()}\n`
35 transcript += `**Updated:** ${new Date(session.time.updated).toLocaleString()}\n\n`
36 transcript += `---\n\n`
37
38 for (const msg of messages) {
39 transcript += formatMessage(msg.info, msg.parts, options, providers)
40 transcript += `---\n\n`
41 }
42
43 return transcript
44}
45
46export function formatMessage(
47 msg: UserMessage | AssistantMessage,

Callers 2

transcript.test.tsFile · 0.90
SessionFunction · 0.90

Calls 1

formatMessageFunction · 0.85

Tested by

no test coverage detected