feat(core): add location-scoped config loading (#29625)

This commit is contained in:
Dax 2026-05-30 00:06:08 -04:00 committed by GitHub
commit 9583e08be4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
89 changed files with 3509 additions and 527 deletions

View file

@ -0,0 +1,12 @@
import { Location } from "@opencode-ai/core/location"
import { Project } from "@opencode-ai/core/project"
import { AbsolutePath } from "@opencode-ai/core/schema"
export function location(ref: Location.Ref, input: { projectDirectory?: AbsolutePath; vcs?: Project.Vcs } = {}) {
return {
directory: ref.directory,
workspaceID: ref.workspaceID,
project: { id: Project.ID.global, directory: input.projectDirectory ?? ref.directory },
vcs: input.vcs,
} satisfies Location.Interface
}