MCPcopy Create free account
hub / github.com/anomalyco/opencode / startRun

Function startRun

packages/opencode/src/effect/runner.ts:83–91  ·  view source on GitHub ↗
(work: Effect.Effect<A, E>, done: Deferred.Deferred<A, E | Cancelled>)

Source from the content-addressed store, hash-verified

81 ).pipe(Effect.flatten)
82
83 const startRun = (work: Effect.Effect<A, E>, done: Deferred.Deferred<A, E | Cancelled>) =>
84 Effect.gen(function* () {
85 const id = next()
86 const fiber = yield* work.pipe(
87 Effect.onExit((exit) => finishRun(id, done, exit)),
88 Effect.forkIn(scope),
89 )
90 return { id, done, fiber } satisfies RunHandle<A, E>
91 })
92
93 const finishShell = (id: number) =>
94 SynchronizedRef.modifyEffect(

Callers 2

finishShellFunction · 0.85
ensureRunningFunction · 0.85

Calls 2

finishRunFunction · 0.85
nextFunction · 0.70

Tested by

no test coverage detected