@@ -454,6 +454,17 @@ export const scheduleConstraintSchema = z.object({
454454
455455} ) ;
456456
457+ export const scheduleConstraintResponseFormatSchema = z . object ( {
458+ dayReference : z . enum ( [ "today" , "tomorrow" , "weekday" ] ) . nullable ( ) ,
459+ weekday : weekdaySchema . nullable ( ) ,
460+ weekOffset : z . number ( ) . int ( ) . min ( 0 ) . max ( 8 ) . nullable ( ) ,
461+ relativeMinutes : z . number ( ) . int ( ) . positive ( ) . max ( 7 * 24 * 60 ) . nullable ( ) . optional ( ) ,
462+ explicitHour : z . number ( ) . int ( ) . min ( 0 ) . max ( 23 ) . nullable ( ) ,
463+ minute : z . number ( ) . int ( ) . min ( 0 ) . max ( 59 ) . nullable ( ) ,
464+ preferredWindow : z . enum ( [ "morning" , "afternoon" , "evening" ] ) . nullable ( ) ,
465+ sourceText : z . string ( ) . min ( 1 )
466+ } ) ;
467+
457468export const taskReferenceSchema = z . discriminatedUnion ( "kind" , [
458469 z . object ( {
459470 kind : z . literal ( "created_task" ) ,
@@ -484,13 +495,27 @@ export const createScheduleBlockPlanningActionSchema = z.object({
484495 reason : z . string ( ) . min ( 1 )
485496} ) ;
486497
498+ export const createScheduleBlockPlanningActionResponseFormatSchema = z . object ( {
499+ type : z . literal ( "create_schedule_block" ) ,
500+ taskRef : taskReferenceSchema ,
501+ scheduleConstraint : scheduleConstraintResponseFormatSchema . nullable ( ) ,
502+ reason : z . string ( ) . min ( 1 )
503+ } ) ;
504+
487505export const moveScheduleBlockPlanningActionSchema = z . object ( {
488506 type : z . literal ( "move_schedule_block" ) ,
489507 blockRef : scheduleBlockReferenceSchema ,
490508 scheduleConstraint : scheduleConstraintSchema . nullable ( ) ,
491509 reason : z . string ( ) . min ( 1 )
492510} ) ;
493511
512+ export const moveScheduleBlockPlanningActionResponseFormatSchema = z . object ( {
513+ type : z . literal ( "move_schedule_block" ) ,
514+ blockRef : scheduleBlockReferenceSchema ,
515+ scheduleConstraint : scheduleConstraintResponseFormatSchema . nullable ( ) ,
516+ reason : z . string ( ) . min ( 1 )
517+ } ) ;
518+
494519export const completeTaskPlanningActionSchema = z . object ( {
495520 type : z . literal ( "complete_task" ) ,
496521 taskRef : taskReferenceSchema ,
@@ -510,12 +535,26 @@ export const planningActionSchema = z.discriminatedUnion("type", [
510535 clarifyPlanningActionSchema
511536] ) ;
512537
538+ export const planningActionResponseFormatSchema = z . discriminatedUnion ( "type" , [
539+ createTaskPlanningActionSchema ,
540+ createScheduleBlockPlanningActionResponseFormatSchema ,
541+ moveScheduleBlockPlanningActionResponseFormatSchema ,
542+ completeTaskPlanningActionSchema ,
543+ clarifyPlanningActionSchema
544+ ] ) ;
545+
513546export const inboxPlanningOutputSchema = z . object ( {
514547 confidence : z . number ( ) . min ( 0 ) . max ( 1 ) ,
515548 summary : z . string ( ) . min ( 1 ) ,
516549 actions : z . array ( planningActionSchema ) . min ( 1 )
517550} ) ;
518551
552+ export const inboxPlanningResponseFormatSchema = z . object ( {
553+ confidence : z . number ( ) . min ( 0 ) . max ( 1 ) ,
554+ summary : z . string ( ) . min ( 1 ) ,
555+ actions : z . array ( planningActionResponseFormatSchema ) . min ( 1 )
556+ } ) ;
557+
519558export const inboxPlanningTaskContextSchema = z . object ( {
520559 alias : z . string ( ) . min ( 1 ) ,
521560 task : taskSchema
0 commit comments