From d42b0e48262fd1e488be88ada08d79a61c8235e5 Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Tue, 14 Apr 2026 21:07:50 -0400 Subject: [PATCH] refactor(provider): use Schema.Literals --- packages/opencode/src/provider/auth.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/provider/auth.ts b/packages/opencode/src/provider/auth.ts index e1123a9c44..4383002a86 100644 --- a/packages/opencode/src/provider/auth.ts +++ b/packages/opencode/src/provider/auth.ts @@ -12,7 +12,7 @@ import z from "zod" export namespace ProviderAuth { export class When extends Schema.Class("ProviderAuthWhen")({ key: Schema.String, - op: Schema.Union([Schema.Literal("eq"), Schema.Literal("neq")]), + op: Schema.Literals(["eq", "neq"]), value: Schema.String, }) { static readonly zod = zod(this) @@ -52,7 +52,7 @@ export namespace ProviderAuth { export type Prompt = Schema.Schema.Type export class Method extends Schema.Class("ProviderAuthMethod")({ - type: Schema.Union([Schema.Literal("oauth"), Schema.Literal("api")]), + type: Schema.Literals(["oauth", "api"]), label: Schema.String, prompts: Schema.optional(Schema.Array(Prompt)), }) { @@ -61,7 +61,7 @@ export namespace ProviderAuth { export class Authorization extends Schema.Class("ProviderAuthAuthorization")({ url: Schema.String, - method: Schema.Union([Schema.Literal("auto"), Schema.Literal("code")]), + method: Schema.Literals(["auto", "code"]), instructions: Schema.String, }) { static readonly zod = zod(this)