MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / normalizeThreadDataForReason

Function normalizeThreadDataForReason

desktop/runtime/thread-publisher.ts:204–217  ·  view source on GitHub ↗
(
  thread: ThreadData,
  reason: RuntimeThreadReason | 'external',
)

Source from the content-addressed store, hash-verified

202}
203
204export function normalizeThreadDataForReason(
205 thread: ThreadData,
206 reason: RuntimeThreadReason | 'external',
207): ThreadData {
208 if (reason === 'compaction-start') {
209 return setThreadCompactingState(thread, true)
210 }
211
212 if (reason !== 'end' && reason !== 'external' && reason !== 'compaction') {
213 return thread
214 }
215
216 return setThreadCompactingState(setThreadStreamingState(thread, false), false)
217}
218
219async function hasPersistedSessionFile(sessionPath: string) {
220 try {

Callers 2

publishThreadUpdateFunction · 0.70

Calls 2

setThreadCompactingStateFunction · 0.90
setThreadStreamingStateFunction · 0.90

Tested by

no test coverage detected