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

Method chain

packages/testing/src/builders/workflow.builder.ts:268–283  ·  view source on GitHub ↗

* Creates a workflow with the specified blocks and connects them linearly.

(...blockConfigs: Array<{ id: string; type: string }>)

Source from the content-addressed store, hash-verified

266 * Creates a workflow with the specified blocks and connects them linearly.
267 */
268 static chain(...blockConfigs: Array<{ id: string; type: string }>): WorkflowBuilder {
269 const builder = new WorkflowBuilder()
270 let x = 0
271 const spacing = 200
272
273 blockConfigs.forEach((config, index) => {
274 builder.addBlock(config.id, config.type, { x, y: 0 })
275 x += spacing
276
277 if (index > 0) {
278 builder.connect(blockConfigs[index - 1].id, config.id)
279 }
280 })
281
282 return builder
283 }
284
285 /**
286 * Creates a linear workflow with N blocks.

Callers 10

toggleSourceFunction · 0.80
LoadedRichMarkdownEditorFunction · 0.80
commands.tsFile · 0.80
addProseMirrorPluginsFunction · 0.80
commitLinkFunction · 0.80
removeLinkFunction · 0.80
EditorBubbleMenuFunction · 0.80
commitEditFunction · 0.80
removeLinkFunction · 0.80

Calls 2

addBlockMethod · 0.95
connectMethod · 0.95

Tested by

no test coverage detected