MCPcopy
hub / github.com/codeaashu/claude-code / summarizeTranscriptChunk

Function summarizeTranscriptChunk

src/commands/insights.ts:881–904  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

879`
880
881async function summarizeTranscriptChunk(chunk: string): Promise<string> {
882 try {
883 const result = await queryWithModel({
884 systemPrompt: asSystemPrompt([]),
885 userPrompt: SUMMARIZE_CHUNK_PROMPT + chunk,
886 signal: new AbortController().signal,
887 options: {
888 model: getAnalysisModel(),
889 querySource: 'insights',
890 agents: [],
891 isNonInteractiveSession: true,
892 hasAppendSystemPrompt: false,
893 mcpTools: [],
894 maxOutputTokensOverride: 500,
895 },
896 })
897
898 const text = extractTextContent(result.message.content)
899 return text || chunk.slice(0, 2000)
900 } catch {
901 // On error, just return truncated chunk
902 return chunk.slice(0, 2000)
903 }
904}
905
906async function formatTranscriptWithSummarization(
907 log: LogOption,

Callers

nothing calls this directly

Calls 4

queryWithModelFunction · 0.85
asSystemPromptFunction · 0.85
getAnalysisModelFunction · 0.85
extractTextContentFunction · 0.50

Tested by

no test coverage detected