23 lines
955 B
TypeScript
23 lines
955 B
TypeScript
import { Schema } from "effect"
|
|
import { zod } from "@opencode-ai/core/effect-zod"
|
|
import { PositiveInt, withStatics } from "@opencode-ai/core/schema"
|
|
|
|
export const Server = Schema.Struct({
|
|
port: Schema.optional(PositiveInt).annotate({
|
|
description: "Port to listen on",
|
|
}),
|
|
hostname: Schema.optional(Schema.String).annotate({ description: "Hostname to listen on" }),
|
|
mdns: Schema.optional(Schema.Boolean).annotate({ description: "Enable mDNS service discovery" }),
|
|
mdnsDomain: Schema.optional(Schema.String).annotate({
|
|
description: "Custom domain name for mDNS service (default: opencode.local)",
|
|
}),
|
|
cors: Schema.optional(Schema.mutable(Schema.Array(Schema.String))).annotate({
|
|
description: "Additional domains to allow for CORS",
|
|
}),
|
|
})
|
|
.annotate({ identifier: "ServerConfig" })
|
|
.pipe(withStatics((s) => ({ zod: zod(s) })))
|
|
export type Server = Schema.Schema.Type<typeof Server>
|
|
|
|
export * as ConfigServer from "./server"
|