@@ -17,7 +17,7 @@ import type { Provider } from "@/provider"
1717import { ModelID , ProviderID } from "@/provider/schema"
1818import { Effect , Schema , Types } from "effect"
1919import { zod , ZodOverride } from "@/util/effect-zod"
20- import { withStatics } from "@/util/schema"
20+ import { NonNegativeInt , withStatics } from "@/util/schema"
2121import { namedSchemaError } from "@/util/named-schema-error"
2222import { EffectLogger } from "@/effect"
2323
@@ -64,9 +64,7 @@ export class OutputFormatText extends Schema.Class<OutputFormatText>("OutputForm
6464export class OutputFormatJsonSchema extends Schema . Class < OutputFormatJsonSchema > ( "OutputFormatJsonSchema" ) ( {
6565 type : Schema . Literal ( "json_schema" ) ,
6666 schema : Schema . Record ( Schema . String , Schema . Any ) . annotate ( { identifier : "JSONSchema" } ) ,
67- retryCount : Schema . Number . check ( Schema . isInt ( ) )
68- . check ( Schema . isGreaterThanOrEqualTo ( 0 ) )
69- . pipe ( Schema . optional , Schema . withDecodingDefault ( Effect . succeed ( 2 ) ) ) ,
67+ retryCount : NonNegativeInt . pipe ( Schema . optional , Schema . withDecodingDefault ( Effect . succeed ( 2 ) ) ) ,
7068} ) {
7169 static readonly zod = zod ( this )
7270}
@@ -138,8 +136,8 @@ export type ReasoningPart = Types.DeepMutable<Schema.Schema.Type<typeof Reasonin
138136const filePartSourceBase = {
139137 text : Schema . Struct ( {
140138 value : Schema . String ,
141- start : Schema . Number . check ( Schema . isInt ( ) ) ,
142- end : Schema . Number . check ( Schema . isInt ( ) ) ,
139+ start : Schema . Int ,
140+ end : Schema . Int ,
143141 } ) . annotate ( { identifier : "FilePartSourceText" } ) ,
144142}
145143
@@ -157,7 +155,7 @@ export const SymbolSource = Schema.Struct({
157155 path : Schema . String ,
158156 range : LSP . Range ,
159157 name : Schema . String ,
160- kind : Schema . Number . check ( Schema . isInt ( ) ) ,
158+ kind : Schema . Int ,
161159} )
162160 . annotate ( { identifier : "SymbolSource" } )
163161 . pipe ( withStatics ( ( s ) => ( { zod : zod ( s ) } ) ) )
@@ -196,8 +194,8 @@ export const AgentPart = Schema.Struct({
196194 source : Schema . optional (
197195 Schema . Struct ( {
198196 value : Schema . String ,
199- start : Schema . Number . check ( Schema . isInt ( ) ) ,
200- end : Schema . Number . check ( Schema . isInt ( ) ) ,
197+ start : Schema . Int ,
198+ end : Schema . Int ,
201199 } ) ,
202200 ) ,
203201} )
@@ -501,8 +499,8 @@ export const AgentPartInput = Schema.Struct({
501499 source : Schema . optional (
502500 Schema . Struct ( {
503501 value : Schema . String ,
504- start : Schema . Number . check ( Schema . isInt ( ) ) ,
505- end : Schema . Number . check ( Schema . isInt ( ) ) ,
502+ start : Schema . Int ,
503+ end : Schema . Int ,
506504 } ) ,
507505 ) ,
508506} )
0 commit comments