fix(core): resolve local references from location root
This commit is contained in:
parent
56ec4b6912
commit
0ce1866e8e
3 changed files with 73 additions and 4 deletions
|
|
@ -2,11 +2,14 @@ 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 } = {}) {
|
||||
export function location(
|
||||
ref: Location.Ref,
|
||||
input: { projectID?: Project.ID; projectDirectory?: AbsolutePath; vcs?: Project.Vcs } = {},
|
||||
) {
|
||||
return {
|
||||
directory: ref.directory,
|
||||
workspaceID: ref.workspaceID,
|
||||
project: { id: Project.ID.global, directory: input.projectDirectory ?? ref.directory },
|
||||
project: { id: input.projectID ?? Project.ID.global, directory: input.projectDirectory ?? ref.directory },
|
||||
vcs: input.vcs,
|
||||
} satisfies Location.Interface
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue