Sfoglia il codice sorgente

refactor(config): drop ZodOverride from PositiveInt in provider.ts (#23215)

Kit Langton 12 ore fa
parent
commit
5181f9b4e1
1 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 4 6
      packages/opencode/src/config/provider.ts

+ 4 - 6
packages/opencode/src/config/provider.ts

@@ -1,12 +1,10 @@
 import { Schema } from "effect"
-import z from "zod"
-import { zod, ZodOverride } from "@/util/effect-zod"
+import { zod } from "@/util/effect-zod"
 import { withStatics } from "@/util/schema"
 
-// Positive integer preserving exact Zod JSON Schema (type: integer, exclusiveMinimum: 0).
-const PositiveInt = Schema.Number.annotate({
-  [ZodOverride]: z.number().int().positive(),
-})
+// Positive integer: emits JSON Schema `type: integer, exclusiveMinimum: 0`
+// via the effect-zod walker's well-known refinement translation.
+const PositiveInt = Schema.Number.check(Schema.isInt()).check(Schema.isGreaterThan(0))
 
 export const Model = Schema.Struct({
   id: Schema.optional(Schema.String),