MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / taskReviewThreadXml

Function taskReviewThreadXml

projects/openade-module/src/node.ts:122–135  ·  view source on GitHub ↗
(task: OpenADETask)

Source from the content-addressed store, hash-verified

120}
121
122function taskReviewThreadXml(task: OpenADETask): string {
123 const events = task.events.filter((event) => eventRecord(event)?.type !== "snapshot")
124 const maxBytes = 240_000
125 const included: unknown[] = []
126 let byteLength = 0
127 for (let index = events.length - 1; index >= 0; index--) {
128 const eventText = JSON.stringify(events[index])
129 const eventBytes = Buffer.byteLength(eventText, "utf8")
130 if (included.length > 0 && byteLength + eventBytes > maxBytes) break
131 included.unshift(events[index])
132 byteLength += eventBytes
133 }
134 return JSON.stringify(included, null, 2)
135}
136
137function recentSnapshotFiles(task: OpenADETask, limit = 40): string[] {
138 const summaries: string[] = []

Callers 2

startReviewFunction · 0.70
runHeadlessHyperPlanTurnFunction · 0.70

Calls 1

eventRecordFunction · 0.70

Tested by

no test coverage detected