Download packages/server/src/handlers/location.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 552 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/location.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/server/src/handlers/location.ts
-
curl -L -o location.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/server/src/handlers/location.ts
552 Bytes
| import { Location } from "@opencode-ai/core/location" | |
| import { Effect } from "effect" | |
| import { HttpApiBuilder } from "effect/unstable/httpapi" | |
| import { Api } from "../api" | |
| export const LocationHandler = HttpApiBuilder.group(Api, "server.location", (handlers) => | |
| handlers.handle( | |
| "location.get", | |
| Effect.fn(function* () { | |
| const location = yield* Location.Service | |
| return new Location.Info({ | |
| directory: location.directory, | |
| workspaceID: location.workspaceID, | |
| project: location.project, | |
| }) | |
| }), | |
| ), | |
| ) | |