refactor(protocol): extract server contracts (#33708)

This commit is contained in:
Kit Langton 2026-06-25 04:15:31 +02:00 committed by GitHub
commit 56a37c3640
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 1070 additions and 878 deletions

View file

@ -0,0 +1,6 @@
import { HttpApiMiddleware } from "effect/unstable/httpapi"
import { UnauthorizedError } from "../errors"
export class Authorization extends HttpApiMiddleware.Service<Authorization>()("@opencode/HttpApiAuthorization", {
error: UnauthorizedError,
}) {}

View file

@ -0,0 +1,7 @@
import { HttpApiMiddleware } from "effect/unstable/httpapi"
import { InvalidRequestError } from "../errors"
export class SchemaErrorMiddleware extends HttpApiMiddleware.Service<SchemaErrorMiddleware>()(
"@opencode/HttpApiSchemaError",
{ error: InvalidRequestError },
) {}