Convert LoadInput.init to Effect + extract InstanceBootstrap as a Service (#25376)

This commit is contained in:
Kit Langton
2026-05-02 00:02:52 -04:00
committed by GitHub
parent 1571933096
commit f33aec1139
21 changed files with 223 additions and 153 deletions

View File

@@ -10,7 +10,7 @@ import fuzzysort from "fuzzysort"
import ignore from "ignore"
import path from "path"
import { Global } from "@opencode-ai/core/global"
import { Instance } from "../project/instance"
import { containsPath } from "../project/instance-context"
import * as Log from "@opencode-ai/core/util/log"
import { Protected } from "./protected"
import { Ripgrep } from "./ripgrep"
@@ -507,7 +507,7 @@ export const layer = Layer.effect(
const ctx = yield* InstanceState.context
const full = path.join(ctx.directory, file)
if (!Instance.containsPath(full, ctx)) {
if (!containsPath(full, ctx)) {
throw new Error("Access denied: path escapes project directory")
}
@@ -587,7 +587,7 @@ export const layer = Layer.effect(
}
const resolved = dir ? path.join(ctx.directory, dir) : ctx.directory
if (!Instance.containsPath(resolved, ctx)) {
if (!containsPath(resolved, ctx)) {
throw new Error("Access denied: path escapes project directory")
}