@@ -18,6 +18,7 @@ class ComputerAction(str, Enum):
1818 TYPE_TEXT = "type_text"
1919 GET_CLIPBOARD_TEXT = "get_clipboard_text"
2020 PUT_SELECTION_TEXT = "put_selection_text"
21+ LIST_WINDOWS = "list_windows"
2122
2223
2324ComputerActionMouseButton = Literal [
@@ -183,6 +184,17 @@ class PutSelectionTextActionParams(BaseModel):
183184 )
184185
185186
187+ class ListWindowsActionParams (BaseModel ):
188+ """Parameters for list windows action."""
189+
190+ model_config = ConfigDict (use_enum_values = True )
191+
192+ action : Literal [ComputerAction .LIST_WINDOWS ] = ComputerAction .LIST_WINDOWS
193+ return_screenshot : bool = Field (
194+ serialization_alias = "returnScreenshot" , default = False
195+ )
196+
197+
186198ComputerActionParams = Union [
187199 ClickActionParams ,
188200 DragActionParams ,
@@ -196,6 +208,7 @@ class PutSelectionTextActionParams(BaseModel):
196208 MouseUpActionParams ,
197209 GetClipboardTextActionParams ,
198210 PutSelectionTextActionParams ,
211+ ListWindowsActionParams ,
199212]
200213
201214
@@ -207,7 +220,27 @@ class ComputerActionResponseDataClipboardText(BaseModel):
207220 clipboard_text : Optional [str ] = Field (default = None , alias = "clipboardText" )
208221
209222
210- ComputerActionResponseData = Union [ComputerActionResponseDataClipboardText ]
223+ class ComputerActionWindow (BaseModel ):
224+ model_config = ConfigDict (populate_by_alias = True )
225+
226+ id : str
227+ name : str
228+ active : bool
229+
230+
231+ class ComputerActionResponseDataListWindows (BaseModel ):
232+ """Data for list windows action."""
233+
234+ model_config = ConfigDict (populate_by_alias = True )
235+
236+ active_window_id : str = Field (default = "" , alias = "activeWindowId" )
237+ windows : List [ComputerActionWindow ] = Field (default_factory = list )
238+
239+
240+ ComputerActionResponseData = Union [
241+ ComputerActionResponseDataListWindows ,
242+ ComputerActionResponseDataClipboardText ,
243+ ]
211244
212245
213246class ComputerActionResponse (BaseModel ):
0 commit comments