mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-14 03:56:55 +03:00
23 lines
901 B
TypeScript
23 lines
901 B
TypeScript
import { Config } from "@opencode-ai/schema/config"
|
|
import { Schema } from "effect"
|
|
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
|
import { LocationQuery, locationQueryOpenApi } from "./location.js"
|
|
|
|
export const ConfigGroup = HttpApiGroup.make("server.config")
|
|
.add(
|
|
HttpApiEndpoint.get("config.get", "/api/config", {
|
|
query: LocationQuery,
|
|
success: Schema.Array(Config.Entry),
|
|
})
|
|
.annotateMerge(locationQueryOpenApi)
|
|
.annotateMerge(
|
|
OpenApi.annotations({
|
|
identifier: "v2.config.get",
|
|
summary: "Get configuration",
|
|
description:
|
|
"Return configuration documents and discovery sources for the requested location, from lowest to highest priority.",
|
|
}),
|
|
),
|
|
)
|
|
.annotateMerge(OpenApi.annotations({ title: "config", description: "Location-scoped configuration routes." }))
|