MCPcopy
hub / github.com/anomalyco/opencode / boot

Function boot

packages/opencode/src/project/instance-store.ts:45–63  ·  view source on GitHub ↗
(input: LoadInput & { directory: string })

Source from the content-addressed store, hash-verified

43 const cache = new Map<string, Entry>()
44
45 const boot = (input: LoadInput & { directory: string }) =>
46 Effect.gen(function* () {
47 const ctx: InstanceContext =
48 input.project && input.worktree
49 ? {
50 directory: input.directory,
51 worktree: input.worktree,
52 project: input.project,
53 }
54 : yield* project.fromDirectory(input.directory).pipe(
55 Effect.map((result) => ({
56 directory: input.directory,
57 worktree: result.sandbox,
58 project: result.project,
59 })),
60 )
61 yield* bootstrap.run.pipe(Effect.provideService(InstanceRef, ctx))
62 return ctx
63 }).pipe(Effect.withSpan("InstanceStore.boot"))
64
65 const removeEntry = (directory: string, entry: Entry) =>
66 Effect.sync(() => {

Callers 5

prompt.test.tsFile · 0.85
completeLoadFunction · 0.85
index.tsFile · 0.85
SortableWorkspaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected