MCPcopy
hub / github.com/simstudioai/sim / removeWorkflowIndexes

Function removeWorkflowIndexes

apps/sim/stores/terminal/console/store.ts:131–152  ·  view source on GitHub ↗
(
  workflowId: string,
  entries: ConsoleEntry[],
  entryIdsByBlockExecution: Record<string, string[]>,
  entryLocationById: Record<string, ConsoleEntryLocation>
)

Source from the content-addressed store, hash-verified

129}
130
131function removeWorkflowIndexes(
132 workflowId: string,
133 entries: ConsoleEntry[],
134 entryIdsByBlockExecution: Record<string, string[]>,
135 entryLocationById: Record<string, ConsoleEntryLocation>
136): void {
137 for (const entry of entries) {
138 delete entryLocationById[entry.id]
139 const blockExecutionKey = getBlockExecutionKey(entry.blockId, entry.executionId)
140 const existingIds = entryIdsByBlockExecution[blockExecutionKey]
141 if (!existingIds) {
142 continue
143 }
144
145 const nextIds = existingIds.filter((entryId) => entryId !== entry.id)
146 if (nextIds.length === 0) {
147 delete entryIdsByBlockExecution[blockExecutionKey]
148 } else {
149 entryIdsByBlockExecution[blockExecutionKey] = nextIds
150 }
151 }
152}
153
154function indexWorkflowEntries(
155 workflowId: string,

Callers 2

replaceWorkflowEntriesFunction · 0.85
appendWorkflowEntryFunction · 0.85

Calls 1

getBlockExecutionKeyFunction · 0.85

Tested by

no test coverage detected