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

Function bootstrap

packages/opencode/src/cli/bootstrap.ts:4–11  ·  view source on GitHub ↗
(directory: string, cb: () => Promise<T>)

Source from the content-addressed store, hash-verified

2import { context } from "../project/instance-context"
3
4export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
5 const ctx = await InstanceRuntime.load({ directory })
6 try {
7 return await context.provide(ctx, cb)
8 } finally {
9 await InstanceRuntime.disposeInstance(ctx)
10 }
11}

Callers 3

withTrackedSnapshotFunction · 0.50
snapshot.test.tsFile · 0.50
createLayerFunction · 0.50

Calls

no outgoing calls

Tested by 1

withTrackedSnapshotFunction · 0.40