MCPcopy Create free account
hub / github.com/ShipSecAI/studio / deriveNodeStates

Function deriveNodeStates

frontend/src/store/executionStore.ts:134–158  ·  view source on GitHub ↗
(events: ExecutionLog[])

Source from the content-addressed store, hash-verified

132const mergeLogEntries = mergeById;
133
134const deriveNodeStates = (events: ExecutionLog[]): Record<string, NodeStatus> => {
135 const states: Record<string, NodeStatus> = {};
136 for (const event of events) {
137 if (!event.nodeId) continue;
138 switch (event.type) {
139 case 'STARTED':
140 states[event.nodeId] = 'running';
141 break;
142 case 'PROGRESS':
143 if (!states[event.nodeId]) {
144 states[event.nodeId] = 'running';
145 }
146 break;
147 case 'COMPLETED':
148 states[event.nodeId] = 'success';
149 break;
150 case 'FAILED':
151 states[event.nodeId] = 'error';
152 break;
153 default:
154 break;
155 }
156 }
157 return states;
158};
159
160const INITIAL_STATE: ExecutionStoreState = {
161 runId: null,

Callers 1

executionStore.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected