filename:
chat/__pycache__/sandbox.cpython-310.pyc
branch:
main
back to repo
o
+��i � @ s� d dl Z d dlZdZe j�e j�e�dd�Ze j�e�rKz#e eddd��Z
e�e
�Ze�
d�ZW d � n1 s9w Y W n eyJ dZY nw ded efd
d�ZdS )� N�agentzconfig.json�rzutf-8)�encoding� WORKSPACE�path�returnc C s~ t | t�s td��tj�t�}| �d�}tj�tj� ||��}z
tj�
||g�}W n ty4 td��w ||kr=td��|S )z�Return a safely-normalized absolute path inside `WORKSPACE`.
Raises ValueError if the resolved path is outside the workspace.
zpath must be a stringz/\z attempted path outside workspace)
�
isinstance�str� TypeError�osr �abspathr �lstrip�normpath�join�
commonpath� Exception�
ValueError)r Z
abs_workspace�relZjoined�common� r �/C:\Users\Ralpo\OneDrive\Desktop\chat\sandbox.py� safe_path s
�r )r �jsonr r r �dirname�__file__�
_agent_cfg�exists�open�_f�load�_j�getr r r r r r r �<module> s
���