forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreference.ts
More file actions
27 lines (26 loc) · 950 Bytes
/
Copy pathreference.ts
File metadata and controls
27 lines (26 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { Location } from "@opencode-ai/schema/location"
import { Reference } from "@opencode-ai/schema/reference"
import { Schema } from "effect"
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
import { LocationQuery, locationQueryOpenApi } from "./location"
export const ReferenceGroup = HttpApiGroup.make("server.reference")
.add(
HttpApiEndpoint.get("reference.list", "/api/reference", {
query: LocationQuery,
success: Location.response(Schema.Array(Reference.Info)),
})
.annotateMerge(locationQueryOpenApi)
.annotateMerge(
OpenApi.annotations({
identifier: "v2.reference.list",
summary: "List references",
description: "List references available in the requested location.",
}),
),
)
.annotateMerge(
OpenApi.annotations({
title: "reference",
description: "Location-scoped project references.",
}),
)