rx4 0.7.1

The agent harness engine — loop, tools, providers, sessions, permissions, computer-use
Documentation
�


��jV��Z�SrSSKJr SSKJr SSKJr SSKJr SSK	J
r
 "SS\5rg	)
z�Pier custom agent: apply a host-produced patch, commit, then exit.

Used after host-side adapters (tk/codex/pi/omp/fx). The DeepSWE collect hook
is `git diff <base> HEAD`, so the applied patch must be committed.
�)�annotations)�Path)�	BaseAgent)�BaseEnvironment)�AgentContextc�z^�\rSrSrSrSS.S
U4Sjjjr\SSj5rSSjrSSjr	S
S	jr
SrU=r$)�ApplyHostPatchAgent�FN)�
patch_filec�2>�Xl[TU]"U0UD6 g�N)r�super�__init__)�selfr�args�kwargs�	__class__s    ��L/Users/undivisible/projects/rotary/scripts/bench/deepswe/apply_host_patch.pyr�ApplyHostPatchAgent.__init__s���$��
���$�)�&�)�c��g)Nzapply-host-patch�rrr�name�ApplyHostPatchAgent.names��!rc��g)Nz1.0.0r)rs r�version�ApplyHostPatchAgent.versions��rc��# �g7fr
r)r�environments  r�setup�ApplyHostPatchAgent.setups����s�c	��Z# �UR(dg[UR5nUR5(aUR5RS:XagSnUR[
U5U5IShv�N URSUSUSUS35IShv�N gN(N7f)Nrz/tmp/host.patchzPcd /app && git config --global --add safe.directory /app && (git apply --binary z || git apply -p1 --binary z || patch -p1 < zr) && git add -A && git -c user.email=bench@rotary -c user.name=rotary-bench commit -m 'host adapter patch' || true)rr�exists�stat�st_size�upload_file�str�exec)r�instructionr�context�src�dests      r�run�ApplyHostPatchAgent.run s���������4�?�?�#���z�z�|�|�s�x�x�z�1�1�Q�6�� ���%�%�c�#�h��5�5�5����
#�#'�&�(C�D�6�IY�Z^�Y_�`5�
5�
�	
�	
�	6�	
�s$�A<B+�>B'�?"B+�!B)�"B+�)B+)rz
str | None)�returnr')rrr/�None)r)r'rrr*rr/r0)
�__name__�
__module__�__qualname__�__firstlineno__�
SUPPORTS_ATIFr�staticmethodrrr r-�__static_attributes__�
__classcell__)rs@rr	r	sc����M�7;�*�*��"��"���
��
�%�
��	
�

�
�
rr	N)�__doc__�
__future__r�pathlibr�pier.agents.baser�pier.environments.baser�pier.models.agent.contextrr	rrr�<module>r?s'���
#��&�2�2�$
�)�$
r