MCPcopy Index your code
hub / github.com/simstudioai/sim / parseStartedMarker

Function parseStartedMarker

apps/sim/lib/logs/execution/progress-markers.ts:168–181  ·  view source on GitHub ↗

* Parse a stored last-started marker, rebuilding it from validated fields so a * stale or wrong-shaped Redis value can never reach API consumers.

(raw: string | undefined)

Source from the content-addressed store, hash-verified

166 * stale or wrong-shaped Redis value can never reach API consumers.
167 */
168function parseStartedMarker(raw: string | undefined): ExecutionLastStartedBlock | undefined {
169 const v = safeJsonParse(raw)
170 if (!isRecord(v)) return undefined
171 const { blockId, blockName, blockType, startedAt } = v
172 if (
173 typeof blockId === 'string' &&
174 typeof blockName === 'string' &&
175 typeof blockType === 'string' &&
176 typeof startedAt === 'string'
177 ) {
178 return { blockId, blockName, blockType, startedAt }
179 }
180 return undefined
181}
182
183/**
184 * Parse a stored last-completed marker, rebuilding it from validated fields so a

Callers 1

getProgressMarkersFunction · 0.85

Calls 2

safeJsonParseFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected