MCPcopy Create free account
hub / github.com/PawanOsman/OpenCursor / stepsToTranscript

Function stepsToTranscript

src/agent/messages.ts:94–107  ·  view source on GitHub ↗
(steps: Step[])

Source from the content-addressed store, hash-verified

92
93/** Serialize steps to plain text for the summarizer (tool outputs truncated). */
94export function stepsToTranscript(steps: Step[]): string {
95 const out: string[] = [];
96 for (const s of steps) {
97 if (s.kind === "user") {
98 out.push(`## User\n${s.text}`);
99 } else if (s.kind === "assistant") {
100 if (s.text) out.push(`## Assistant\n${s.text}`);
101 for (const c of s.calls || []) out.push(`## Assistant tool call: ${c.name}\n${(c.arguments || "").slice(0, 400)}`);
102 } else {
103 out.push(`## Tool result (${s.name})\n${(s.output || "").slice(0, 600)}`);
104 }
105 }
106 return out.join("\n\n");
107}
108
109export interface CursorContextBlocks {
110 /** <user_info> + <rules> + <agent_skills> */

Callers 1

summarizeStepsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected