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

Method buildPausedResult

apps/sim/executor/execution/engine.ts:493–524  ·  view source on GitHub ↗
(startTime: number)

Source from the content-addressed store, hash-verified

491 }
492
493 private buildPausedResult(startTime: number): ExecutionResult {
494 const endTime = performance.now()
495 this.context.metadata.endTime = new Date().toISOString()
496 this.context.metadata.duration = endTime - startTime
497 this.context.metadata.status = 'paused'
498
499 const snapshotSeed = serializePauseSnapshot(this.context, [], this.dag, this.edgeManager)
500 const pausePoints: PausePoint[] = Array.from(this.pausedBlocks.values()).map((pause) => ({
501 contextId: pause.contextId,
502 blockId: pause.blockId,
503 response: pause.response,
504 registeredAt: pause.timestamp,
505 resumeStatus: 'paused' as ResumeStatus,
506 snapshotReady: true,
507 parallelScope: pause.parallelScope,
508 loopScope: pause.loopScope,
509 resumeLinks: pause.resumeLinks,
510 pauseKind: pause.pauseKind,
511 resumeAt: pause.resumeAt,
512 }))
513
514 return {
515 success: true,
516 output: this.collectPauseResponses(),
517 logs: this.context.blockLogs,
518 executionState: this.getSerializableExecutionState(snapshotSeed),
519 metadata: this.context.metadata,
520 status: 'paused',
521 pausePoints,
522 snapshotSeed,
523 }
524 }
525
526 private getSerializableExecutionState(snapshotSeed?: {
527 snapshot: string

Callers 1

runMethod · 0.95

Calls 3

collectPauseResponsesMethod · 0.95
serializePauseSnapshotFunction · 0.90

Tested by

no test coverage detected