MCPcopy Index your code
hub / github.com/anomalyco/opencode / captureSync

Function captureSync

packages/opencode/src/effect/bridge.ts:19–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19function captureSync() {
20 const fiber = Fiber.getCurrent()
21 const instance = fiber ? Context.getReferenceUnsafe(fiber.context, InstanceRef) : undefined
22 const workspace =
23 (fiber ? Context.getReferenceUnsafe(fiber.context, WorkspaceRef) : undefined) ?? WorkspaceContext.workspaceID
24 return { instance, workspace }
25}
26
27export const bind = <Args extends readonly unknown[], Result>(fn: (...args: Args) => Result) => {
28 const captured = captureSync()

Callers 2

bindFunction · 0.85
makeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected