MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / normalizeWorkflowRun

Function normalizeWorkflowRun

src/utils/workflowRuns.ts:74–97  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

72}
73
74function normalizeWorkflowRun(value: unknown): WorkflowRunRecord | null {
75 if (!isRecord(value)) return null
76 if (typeof value.runId !== 'string') return null
77 if (typeof value.workflow !== 'string') return null
78 if (!isWorkflowRunStatus(value.status)) return null
79 if (typeof value.createdAt !== 'number') return null
80 if (typeof value.updatedAt !== 'number') return null
81 if (typeof value.currentStepIndex !== 'number') return null
82 if (!Array.isArray(value.steps)) return null
83 const steps = value.steps
84 .map(normalizeWorkflowStep)
85 .filter((step): step is WorkflowRunStepRecord => step !== null)
86 if (steps.length !== value.steps.length) return null
87 return {
88 runId: value.runId,
89 workflow: value.workflow,
90 ...(typeof value.args === 'string' ? { args: value.args } : {}),
91 status: value.status,
92 createdAt: value.createdAt,
93 updatedAt: value.updatedAt,
94 currentStepIndex: value.currentStepIndex,
95 steps,
96 }
97}
98
99async function readWorkflowRun(
100 rootDir: string,

Callers 1

readWorkflowRunFunction · 0.85

Calls 2

isWorkflowRunStatusFunction · 0.85
isRecordFunction · 0.70

Tested by

no test coverage detected