Compare commits

...

2 Commits

Author SHA1 Message Date
Kit Langton d9f6377e12 test(workspace): use instance effect fixture 2026-05-15 22:21:32 -04:00
Kit Langton 85acc9564e refactor(instance): remove ambient instance context 2026-05-15 22:08:31 -04:00
3 changed files with 459 additions and 436 deletions
+1 -2
View File
@@ -1,10 +1,9 @@
import { InstanceRuntime } from "../project/instance-runtime"
import { context } from "../project/instance-context"
export async function bootstrap<T>(directory: string, cb: () => Promise<T>) {
const ctx = await InstanceRuntime.load({ directory })
try {
return await context.provide(ctx, cb)
return await cb()
} finally {
await InstanceRuntime.disposeInstance(ctx)
}
@@ -1,4 +1,3 @@
import { LocalContext } from "@/util/local-context"
import { AppFileSystem } from "@opencode-ai/core/filesystem"
import type * as Project from "./project"
@@ -8,8 +7,6 @@ export interface InstanceContext {
project: Project.Info
}
export const context = LocalContext.create<InstanceContext>("instance")
/**
* Check if a path is within the project boundary.
* Returns true if path is inside ctx.directory OR ctx.worktree.
File diff suppressed because it is too large Load Diff