88
99from pydantic import BaseModel , Field , RootModel
1010
11+
1112PermissionOptionKind = Literal ["allow_once" , "allow_always" , "reject_once" , "reject_always" ]
1213PlanEntryPriority = Literal ["high" , "medium" , "low" ]
1314PlanEntryStatus = Literal ["pending" , "in_progress" , "completed" ]
1415StopReason = Literal ["end_turn" , "max_tokens" , "max_turn_requests" , "refusal" , "cancelled" ]
1516ToolCallStatus = Literal ["pending" , "in_progress" , "completed" , "failed" ]
16- ToolKind = Literal [
17- "read" ,
18- "edit" ,
19- "delete" ,
20- "move" ,
21- "search" ,
22- "execute" ,
23- "think" ,
24- "fetch" ,
25- "switch_mode" ,
26- "other" ,
27- ]
17+ ToolKind = Literal ["read" , "edit" , "delete" , "move" , "search" , "execute" , "think" , "fetch" , "switch_mode" , "other" ]
2818
2919
3020class AuthenticateRequest (BaseModel ):
@@ -646,10 +636,7 @@ class PermissionOption(BaseModel):
646636 Optional [Any ],
647637 Field (alias = "_meta" , description = "Extension point for implementations" ),
648638 ] = None
649- kind : Annotated [
650- PermissionOptionKind ,
651- Field (description = "Hint about the nature of this permission option." ),
652- ]
639+ kind : Annotated [PermissionOptionKind , Field (description = "Hint about the nature of this permission option." )]
653640 name : Annotated [str , Field (description = "Human-readable label to display to the user." )]
654641 optionId : Annotated [str , Field (description = "Unique identifier for this permission option." )]
655642
@@ -669,21 +656,15 @@ class PlanEntry(BaseModel):
669656 description = "The relative importance of this task.\n Used to indicate which tasks are most critical to the overall goal."
670657 ),
671658 ]
672- status : Annotated [
673- PlanEntryStatus ,
674- Field (description = "Current execution status of this task." ),
675- ]
659+ status : Annotated [PlanEntryStatus , Field (description = "Current execution status of this task." )]
676660
677661
678662class PromptResponse (BaseModel ):
679663 field_meta : Annotated [
680664 Optional [Any ],
681665 Field (alias = "_meta" , description = "Extension point for implementations" ),
682666 ] = None
683- stopReason : Annotated [
684- StopReason ,
685- Field (description = "Indicates why the agent stopped processing the turn." ),
686- ]
667+ stopReason : Annotated [StopReason , Field (description = "Indicates why the agent stopped processing the turn." )]
687668
688669
689670class ReadTextFileRequest (BaseModel ):
@@ -932,20 +913,14 @@ class ToolCallUpdate(BaseModel):
932913 Optional [List [Union [ContentToolCallContent , FileEditToolCallContent , TerminalToolCallContent ]]],
933914 Field (description = "Replace the content collection." ),
934915 ] = None
935- kind : Annotated [
936- Optional [ToolKind ],
937- Field (description = "Update the tool kind." ),
938- ] = None
916+ kind : Annotated [Optional [ToolKind ], Field (description = "Update the tool kind." )] = None
939917 locations : Annotated [
940918 Optional [List [ToolCallLocation ]],
941919 Field (description = "Replace the locations collection." ),
942920 ] = None
943921 rawInput : Annotated [Optional [Any ], Field (description = "Update the raw input." )] = None
944922 rawOutput : Annotated [Optional [Any ], Field (description = "Update the raw output." )] = None
945- status : Annotated [
946- Optional [ToolCallStatus ],
947- Field (description = "Update the execution status." ),
948- ] = None
923+ status : Annotated [Optional [ToolCallStatus ], Field (description = "Update the execution status." )] = None
949924 title : Annotated [Optional [str ], Field (description = "Update the human-readable title." )] = None
950925 toolCallId : Annotated [str , Field (description = "The ID of the tool call being updated." )]
951926
@@ -988,10 +963,7 @@ class ToolCallStart(BaseModel):
988963 rawInput : Annotated [Optional [Any ], Field (description = "Raw input parameters sent to the tool." )] = None
989964 rawOutput : Annotated [Optional [Any ], Field (description = "Raw output returned by the tool." )] = None
990965 sessionUpdate : Literal ["tool_call" ]
991- status : Annotated [
992- Optional [ToolCallStatus ],
993- Field (description = "Current execution status of the tool call." ),
994- ] = None
966+ status : Annotated [Optional [ToolCallStatus ], Field (description = "Current execution status of the tool call." )] = None
995967 title : Annotated [
996968 str ,
997969 Field (description = "Human-readable title describing what the tool is doing." ),
@@ -1011,21 +983,15 @@ class ToolCallProgress(BaseModel):
1011983 Optional [List [Union [ContentToolCallContent , FileEditToolCallContent , TerminalToolCallContent ]]],
1012984 Field (description = "Replace the content collection." ),
1013985 ] = None
1014- kind : Annotated [
1015- Optional [ToolKind ],
1016- Field (description = "Update the tool kind." ),
1017- ] = None
986+ kind : Annotated [Optional [ToolKind ], Field (description = "Update the tool kind." )] = None
1018987 locations : Annotated [
1019988 Optional [List [ToolCallLocation ]],
1020989 Field (description = "Replace the locations collection." ),
1021990 ] = None
1022991 rawInput : Annotated [Optional [Any ], Field (description = "Update the raw input." )] = None
1023992 rawOutput : Annotated [Optional [Any ], Field (description = "Update the raw output." )] = None
1024993 sessionUpdate : Literal ["tool_call_update" ]
1025- status : Annotated [
1026- Optional [ToolCallStatus ],
1027- Field (description = "Update the execution status." ),
1028- ] = None
994+ status : Annotated [Optional [ToolCallStatus ], Field (description = "Update the execution status." )] = None
1029995 title : Annotated [Optional [str ], Field (description = "Update the human-readable title." )] = None
1030996 toolCallId : Annotated [str , Field (description = "The ID of the tool call being updated." )]
1031997
@@ -1051,10 +1017,7 @@ class ToolCall(BaseModel):
10511017 ] = None
10521018 rawInput : Annotated [Optional [Any ], Field (description = "Raw input parameters sent to the tool." )] = None
10531019 rawOutput : Annotated [Optional [Any ], Field (description = "Raw output returned by the tool." )] = None
1054- status : Annotated [
1055- Optional [ToolCallStatus ],
1056- Field (description = "Current execution status of the tool call." ),
1057- ] = None
1020+ status : Annotated [Optional [ToolCallStatus ], Field (description = "Current execution status of the tool call." )] = None
10581021 title : Annotated [
10591022 str ,
10601023 Field (description = "Human-readable title describing what the tool is doing." ),
0 commit comments