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

Function recentSnapshotFiles

projects/openade-module/src/node.ts:137–161  ·  view source on GitHub ↗
(task: OpenADETask, limit = 40)

Source from the content-addressed store, hash-verified

135}
136
137function recentSnapshotFiles(task: OpenADETask, limit = 40): string[] {
138 const summaries: string[] = []
139 const seen = new Set<string>()
140
141 for (let index = task.events.length - 1; index >= 0 && summaries.length < limit; index--) {
142 const record = eventRecord(task.events[index])
143 if (record?.type !== "snapshot") continue
144 const files = Array.isArray(record.files) ? record.files : []
145 for (const value of files) {
146 const file = eventRecord(value)
147 if (!file) continue
148 const filePath = typeof file.path === "string" ? file.path : undefined
149 const status = typeof file.status === "string" ? file.status : undefined
150 if (!filePath || !status) continue
151 const oldPath = typeof file.oldPath === "string" ? file.oldPath : undefined
152 const summary = status === "renamed" && oldPath ? `renamed: ${oldPath} -> ${filePath}` : `${status}: ${filePath}`
153 if (seen.has(summary)) continue
154 seen.add(summary)
155 summaries.push(summary)
156 if (summaries.length >= limit) break
157 }
158 }
159
160 return summaries
161}
162
163function notifyTaskChanged(server: RuntimeServer | undefined, repoId: string, taskId: string): void {
164 if (!server) return

Callers 1

startReviewFunction · 0.70

Calls 3

hasMethod · 0.80
pushMethod · 0.80
eventRecordFunction · 0.70

Tested by

no test coverage detected