MCPcopy Index your code
hub / github.com/anomalyco/opencode / ref

Function ref

packages/server/src/location.ts:29–39  ·  view source on GitHub ↗
(request: HttpServerRequest.HttpServerRequest)

Source from the content-addressed store, hash-verified

27}
28
29function ref(request: HttpServerRequest.HttpServerRequest): Location.Ref {
30 const query = new URL(request.url, "http://localhost").searchParams
31 const workspaceID = query.get("location[workspace]") || request.headers["x-opencode-workspace"]
32 const directory =
33 query.get("location[directory]") ||
34 (request.headers["x-opencode-directory"] ? decode(request.headers["x-opencode-directory"]) : process.cwd())
35 return Location.Ref.make({
36 directory: AbsolutePath.make(directory),
37 workspaceID: workspaceID ? WorkspaceV2.ID.make(workspaceID) : undefined,
38 })
39}
40
41function decode(input: string) {
42 try {

Callers 3

location.tsFile · 0.70
HomeFunction · 0.50
forwardTabRefFunction · 0.50

Calls 4

decodeFunction · 0.70
getMethod · 0.65
cwdMethod · 0.65
makeMethod · 0.45

Tested by

no test coverage detected