@@ -63,50 +63,42 @@ export const modelOptionSchema = z.object({
6363
6464export type ModelOption = z . infer < typeof modelOptionSchema > ;
6565
66- const sessionConfigSelectOptionSchema = z
67- . object ( {
68- value : z . string ( ) ,
69- name : z . string ( ) ,
70- description : z . string ( ) . nullish ( ) ,
71- _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
72- } )
73- . passthrough ( ) ;
74-
75- const sessionConfigSelectGroupSchema = z
76- . object ( {
77- group : z . string ( ) ,
78- name : z . string ( ) ,
79- options : z . array ( sessionConfigSelectOptionSchema ) ,
80- _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
81- } )
82- . passthrough ( ) ;
83-
84- const sessionConfigSelectSchema = z
85- . object ( {
86- id : z . string ( ) ,
87- name : z . string ( ) ,
88- type : z . literal ( "select" ) ,
89- currentValue : z . string ( ) ,
90- options : z
91- . array ( sessionConfigSelectOptionSchema )
92- . or ( z . array ( sessionConfigSelectGroupSchema ) ) ,
93- category : z . string ( ) . nullish ( ) ,
94- description : z . string ( ) . nullish ( ) ,
95- _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
96- } )
97- . passthrough ( ) ;
98-
99- const sessionConfigBooleanSchema = z
100- . object ( {
101- id : z . string ( ) ,
102- name : z . string ( ) ,
103- type : z . literal ( "boolean" ) ,
104- currentValue : z . boolean ( ) ,
105- category : z . string ( ) . nullish ( ) ,
106- description : z . string ( ) . nullish ( ) ,
107- _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
108- } )
109- . passthrough ( ) ;
66+ const sessionConfigSelectOptionSchema = z . looseObject ( {
67+ value : z . string ( ) ,
68+ name : z . string ( ) ,
69+ description : z . string ( ) . nullish ( ) ,
70+ _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
71+ } ) ;
72+
73+ const sessionConfigSelectGroupSchema = z . looseObject ( {
74+ group : z . string ( ) ,
75+ name : z . string ( ) ,
76+ options : z . array ( sessionConfigSelectOptionSchema ) ,
77+ _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
78+ } ) ;
79+
80+ const sessionConfigSelectSchema = z . looseObject ( {
81+ id : z . string ( ) ,
82+ name : z . string ( ) ,
83+ type : z . literal ( "select" ) ,
84+ currentValue : z . string ( ) ,
85+ options : z
86+ . array ( sessionConfigSelectOptionSchema )
87+ . or ( z . array ( sessionConfigSelectGroupSchema ) ) ,
88+ category : z . string ( ) . nullish ( ) ,
89+ description : z . string ( ) . nullish ( ) ,
90+ _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
91+ } ) ;
92+
93+ const sessionConfigBooleanSchema = z . looseObject ( {
94+ id : z . string ( ) ,
95+ name : z . string ( ) ,
96+ type : z . literal ( "boolean" ) ,
97+ currentValue : z . boolean ( ) ,
98+ category : z . string ( ) . nullish ( ) ,
99+ description : z . string ( ) . nullish ( ) ,
100+ _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
101+ } ) ;
110102
111103export const sessionConfigOptionSchema = z . union ( [
112104 sessionConfigSelectSchema ,
@@ -124,13 +116,11 @@ export const sessionResponseSchema = z.object({
124116export type SessionResponse = z . infer < typeof sessionResponseSchema > ;
125117
126118// Prompt input/output
127- export const contentBlockSchema = z
128- . object ( {
129- type : z . string ( ) ,
130- text : z . string ( ) . optional ( ) ,
131- _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
132- } )
133- . passthrough ( ) ;
119+ export const contentBlockSchema = z . looseObject ( {
120+ type : z . string ( ) ,
121+ text : z . string ( ) . optional ( ) ,
122+ _meta : z . record ( z . string ( ) , z . unknown ( ) ) . nullish ( ) ,
123+ } ) ;
134124
135125export const promptInput = z . object ( {
136126 sessionId : z . string ( ) ,
0 commit comments