�
���g � �8 � d dl mZmZ d dlmZ d dlmZ defd�Zy)� )�FastMCP�Context)�Optional)�get_unity_connection�mcpc
� � | j � dt dt fd�� }| j � dt dt fd�� }| j � dt dt fd�� }| j � dt dt fd�� }| j � dt dt fd�� }| j � dt dt d t dt fd
�� }| j � ddt dt dt dt fd
�� }y)z6Register all editor control tools with the MCP server.�ctx�returnc � � t � j dddi� }|j dd� S # t $ r}dt |� � �cY d}~S d}~ww xY w)z�Undo the last action performed in the Unity editor.
Returns:
str: Success message or error details
�EDITOR_CONTROL�command�UNDO�messagezUndo performed successfullyzError performing undo: N�r �send_command�get� Exception�str�r �response�es ��C:\1_Sagyo\VRchat\Project\IshouJidouChouseiToul\Library\PackageCache\com.zundamonnovrchat.unity-mcp-ollama@994ecdcda9\Python\tools\editor_tools.py�undoz#register_editor_tools.<locals>.undo �] � � 6�+�-�:�:�;K��6�N� �H� �<�<� �+H�I�I��� 6�,�S��V�H�5�5�� 6�� �-0 � A�
A�A�Ac � � t � j dddi� }|j dd� S # t $ r}dt |� � �cY d}~S d}~ww xY w)z�Redo the last undone action in the Unity editor.
Returns:
str: Success message or error details
r r
�REDOr zRedo performed successfullyzError performing redo: Nr r s r �redoz#register_editor_tools.<locals>.redo r r c � � t � j dddi� }|j dd� S # t $ r}dt |� � �cY d}~S d}~ww xY w)z�Start the game in play mode within the Unity editor.
Returns:
str: Success message or error details
r r
�PLAYr zEntered play modezError entering play mode: Nr r s r �playz#register_editor_tools.<locals>.play&