Team Ai
Apppublic

Muskan02/llm-code-deployer

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
main.cpython-313.pyc174 linesDownload Raw Back to __pycache__
1�

2#=�h�q���SSKJrJr SSKJr SSKJr SSKJr SSK	r	SSK3r4SSKrSSKrSSK
r
SSKrSSKrSSKrSSKrSSKr\"5rS\S\4SjrS	rS5\R0S3rSr\R6r\"S
SS9r0qS\S\S\S\S\S\R>4Sjr S\R>S\S\S\S\!46Sjr"S\S\!4Sjr#S\S\4Sjr$S\S\!S\4Sjr%S\S\S\&S\!4S jr'S!\S"\S\S\S#\S$\S%\S&\S\4S'jr(S(\S)\&S\&4S*jr)S+\4S,jr*\RWS-S.S/9S+\4S0j5r,\R[S15S25r.\R[S35S45r/g)5�)�FastAPI�
HTTPException)�JSONResponse)�TaskRequest)�get_settingsN�secret_from_request�returnc�(�U[R:H$)zBChecks if the provided secret matches the expected student secret.)�settings�STUDENT_SECRET)rs �/C:\Users\praty\Downloads\GEMINI_PROJECT\main.py�
verify_secretrs���(�"9�"9�9�9�zhttps://api.github.com�https://z7.github.iozfhttps://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-05-20:generateContentz#Automated Task Receiver & ProcessorzUEndpoint for receiving task assignments and triggering AI code generation/deployment.)�title�description�8local_path�	repo_name�
repo_url_auth�
repo_url_http�round_indexc	��# �[Rn[RnSU3SSS.n[R"SS9IShv�NnUS:Xa�[S	US935 USSS
.n	UR
[S3X�S9IShv�Nn10U11R5 [RRU5nURSU5 [S5 OFUS:�a@[SUSUS35 [RRX 5n[SUS35 WsSSS5IShv�N $N�N�N	![RaJn[SURR SURR"S35 [%S5eSnAf[R&an[SUS35 [%S5eSnAff=f!,IShv�N(df   g=f7f)z`Handles creating the remote repo (R1) or cloning the existing one (R2+) into an EMPTY directory.�token �application/vnd.github.v3+json�122022-11-28��
Authorization�AcceptzX-GitHub-Api-Version�-��timeoutN�z&   -> R1: Creating remote repository 'z'...FT)�name�private�	auto_initz/user/repos��json�headers�originz+   -> R1: Local git repository initialized.�z   -> Rz#: Cloning existing repository from z...z): Repository cloned and ready for update.�3--- [API ERROR] GitHub API call failed with status �: � ---z/GitHub API call failed during repository setup.�1--- [GIT ERROR] Failed to perform git operation: z-Git operation failed during repository setup.)r�GITHUB_USERNAME�GITHUB_TOKEN�httpx�AsyncClient�print�post�GITHUB_API_BASE�raise_for_status�git�Repo�init�
create_remote�13clone_from�HTTPStatusError�response�status_code�text�	Exception�GitCommandError)
rrrrr�github_username�github_tokenr(�client�payloadr=�repo�es
             r
�setup_local_reporH/s�����.�.�O��(�(�L�"�,��0�2� ,��G�� � ��,�,��	M��a���>�y�k��N�O�#,��T�R��!'����/@��-L�SZ��!l�l���)�)�+��x�x�}�}�Z�0���"�"�8�]�;��C�D���!����}�,O�P]��^a�b�c��x�x�*�*�=�E�����}�,U�V�W��+-�,�,�m�
-��.�$�$�	O��G��14�15�H^�H^�G_�_a�bc�bl�bl�bq�bq�ar�rv�w�x��M�N�N���"�"�	M��E�a�S��M�N��K�L�L��	M��5-�,�,�s��AG�D*�G�G�165D0�?D,�BD0�G�$D.�%G�,D0�.G�0F?�AF	�	F?� F:�:F?�?G�G�G�	G�GrF�task_idc	��# �[Rn[RnSU3SSS.nSUSU3n[R"SS9IS	hv�NnUR17R
S18S9 SUS
US3n	URRU	5 URRRn19[SU2035 UR21RSS5 [S5 UR22RSSSS23S9 [S5 [S5 [R "S5IS	hv�N [S5 ["SUSUS3nSSSS.0nSn
Sn[%U
5H�nUR'X�S 9IS	hv�NnUR(S!:HnU(a9[S"US#-S$35 UR+X�US%9IS	hv�NR-5 O8[S&US#-S$35 UR/X�US%9IS	hv�NR-5 [S'5  O
 [7S-5e[S.5 [R "S5IS	hv�N [8SUS3nUU24US/.sS	S	S	5IS	hv�N $GN GN@N�N�N�![R0anUR2R(S(:Xa_S)UR2R4;aEX�S#-25:a=US*U--n[S+US,35 [R "U5IS	hv�N S	nAGM�eS	nAff=fN�N�![26R:an[S0US135 [7S25eS	nAf[R0aJn[S3UR2R(S4UR2R4S135 [7S55eS	nAf[6an[S6US135 eS	nAff=f!,IS	hv�N(df   g	=f7f)7zXHandles adding, committing, pushing, and configuring GitHub Pages after files are saved.rrrr�https://github.com/�/rr NT)�A�Task z	 - Round z#: LLM-generated app update/creationz   -> Files committed. SHA: z-M�mainz   -> Branch renamed to 'main'.z--set-upstreamr))�forcez-   -> Changes pushed to remote 'main' branch.zB   -> Waiting 10 seconds for GitHub to register the main branch...�27z2   -> Enabling GitHub Pages with robust retries...z/repos/z/pages�source)�branch�path��)r(��z4   -> Pages exists. Updating configuration (Attempt r"z).r&z,   -> Creating Pages configuration (Attempt z%   -> Pages configuration successful.i�zmain branch must existr*z8   -> [Timing Issue] Branch not recognized. Retrying in z seconds...zPFailed to configure GitHub Pages after multiple retries due to branch existence.z6   -> Waiting 5 seconds for GitHub Pages deployment...)�repo_url�28commit_sha�	pages_urlr.r-z'Git operation failed during deployment.r+r,z)GitHub API call failed during deployment.z(--- [CRITICAL ERROR] Deployment failed: )rr/r0r1r2r7�add�index�commit�head�object�hexshar3rS�push�asyncio�sleepr5�range�getr>�putr6r4r<r=r?r@�GITHUB_PAGES_BASErA)rFrIrrrBrCr(rrD�commit_messagerY�
pages_api_url�
pages_payload�pages_max_retries�pages_base_delay�
retry_attempt�pages_response�
is_configuredrG�delayrZs                     r
�commit_and_publishrqZs�����.�.�O��(�(�L�"�,��0�2� ,��G�29*�/�):�!�I�;�G�M�� � ��,�,��G	�
�H�H�L�L�4�L� �$�W�I�Y�{�m�Cf�g�N��J�J���n�-����)�)�0�0�J��0���=�>�
�H�H�O�O�D�&�)��3�4��H�H�M�M�*�H�f�D�M�I��A�B�
�V�W��-�-��#�#�#�
�F�G�.�/�w��6G�q���SY�Z�M�%�&�#�'F�G�M� !�� ��!&�'8�!9�
��+1�:�:�m�:�+U�%U�N�%3�%?�%?�3�%F�M�$�� T�Ub�ef�Uf�Tg�gi�j�k�%�z�z�-�U\�z�]�]�o�o�q�� L�]�]^�M^�L_�_a�b�c�%�{�{�=�V]�{�^�^�p�p�r��A�B��":�. � r�s�s�
�J�K��-�-��"�"�"�,�-�Q�y�k��;�I�*�(�&��u-�,�,�$
$�&V�30^�_��31�,�,���z�z�-�-��4�9Q�UV�U_�U_�Ud�Ud�9d�iv�NO�zO�jO� 0�A��4F� G��� X�Y^�X_�_j�k�l�%�m�m�E�2�2�2�2���
��
#�m-��@�"�"�	G��E�a�S��M�N��E�F�F���$�$�	I��G��32�33�H^�H^�G_�_a�bc�bl�bl�bq�bq�ar�rv�w�x��G�H�H���	��<�Q�C�t�D�E���	��M-�,�,�s�A34O�I,�
O�O�CL�/I/�07L�(I8�:I2�;?I8�:I4�;8I8�3I6�4I8�3L�L�L�O�&L�'O�/L�2I8�4I8�6I8�8L�A,L�8K;35�9L�>L�L�L�L�O�N>�&M�N>�AN�
N>�)N9�9N>�>O�O�O36�O�O�data_uric��U(aURS5(d[S5 g[R"SU[R5nU(d[S5 gURS5nURS5nURS5(d[S	U35 gS37UUS.0$![an[SU35 SnAgSnAff=f)
z�38Extracts Base64 data and MIME type from a Data URI and formats it 39as the 'inlineData' structure required for a Gemini API multimodal part.40�data:z!ERROR: Invalid Data URI provided.Nz4data:(?P<mime_type>[^;]+);base64,(?P<base64_data>.*)z9ERROR: Could not parse MIME type or base64 data from URI.�	mime_type�base64_datazimage/z.Skipping attachment with non-image MIME type: �41inlineData)�data�mimeTypez%ERROR creating Gemini Part from URI: )�42startswithr3�re�search�43IGNORECASE�groupr@)rr�matchrurvrGs     r
�data_uri_to_gemini_partr��s���44�8�.�.�w�7�7�
�1�2����	�	�Q�S[�]_�]j�]j�k����M�N���K�K��,�	��k�k�-�0���#�#�H�-�-��B�9�+�N�O��
�#�%��45�	46����
�5�a�S�9�:����s$�8B2�$AB2�+B2�247C�<C�Cc��URS5(dg[R"SU[R5SL$)zAChecks if the data URI refers to an image based on the MIME type.rtFzdata:image/[^;]+;base64,N)rzr{r|r})rrs r
�is_image_data_urir��s4�����w�'�'��
�9�9�0�(�B�M�M�J�RV�V�Vr�filesc	��r# �[RR[R"5S5n[RRX 5n[R"USS9 [SUS35 UR
5HeupE[RRX45n[USSS9nURU5 S	S	S	5 [S48US[U5S35 Mg U$!,(df   N/=f![a%n[S
USU35 [SUS35eS	nAff=f7f)z�49Saves the generated files (index.html, README.md, LICENSE) into a local 50directory named after the task_id within the 'generated_tasks' folder.51�generated_tasksT��exist_okz"--- [LOCAL_SAVE] Saving files to: r-�wzutf-8)�encodingNz
   -> Saved: � (Size: � bytes)z   -> ERROR saving r,zFailed to save file �	 locally.)�osrT�join�getcwd�makedirsr3�items�open�write�lenr@)	rIr��base_dir�task_dir�filename�content�	file_path�frGs	         r
�save_generated_files_locallyr��s52���53�w�w�|�|�B�I�I�K�):�;�H��w�w�|�|�H�.�H��K�K��4�(�	�.�x�j��54=�>�#�[�[�]����G�G�L�L��4�	�	H��i��w�7�1����� �8��M�(��8�C��L�>��I�J�
+��O�8�7���	H��'��z��A�3�7�8��2�8�*�I�F�G�G��	H�sB�B+D7�.D�9C4�#D�.D7�455D	�>D�56D4� D/�/D4�4D7�prompt�image_partsc	���# �[SUS35 UR5R5nSU;aSU;a[S5 US-
nSnSS	S57S.S	SS.S	S
S.S./SQS.n/nU(aUSU0/-nURSU05 OURSSU0/05 USSU0/0SUS.S.nSn	Sn58[	U	5H�n[59S[3n[R"SS9IShv�Nn
U
RUUSS0S9IShv�NnUR5 UR5nUSSSSSSn[R"U5n[S US-S!35 UsSSS5IShv�N s $ [S(5 ['S)5eN�N�N#!,IShv�N(df   O=f![Ran[S"US-S#US!35 SnAONSnAf[R[[R 4an[S$US-S#US!35 SnAOSnAff=fX�S-60:dGM{U61S%U--n[S&US'35 ["R$"U5IShv�N GM�7f)*z�62Calls the Gemini API to generate the web application code and structured63metadata (README and LICENSE), now supporting image inputs.64The response is strictly validated against a JSON schema.65z5--- [LLM_CALL] Attempting to generate code for Task: z using Gemini API ---zcaptcha solver�66responsiveuJ--- [LLM_CALL] Detected vague captcha solver prompt — auto-expanding ---a�67 68Ensure the web app is a single, complete, fully responsive HTML file using Tailwind CSS. It must fetch an image from the query parameter '?url=https://.../image.png', display it, and perform OCR using Tesseract.js via CDN. If the URL parameter is missing, use the attached sample image by default. Show the recognized text and any errors clearly in the UI. Return output strictly as a JSON object with keys: 'index.html', 'README.md', and 'LICENSE'.a�You are an expert full-stack engineer and technical writer. Your task is to generate three files in a single structured JSON response: 'index.html', 'README.md', and 'LICENSE'. The 'index.html' must be a single, complete, fully responsive HTML file using Tailwind CSS for styling and must implement the requested application logic. The 'README.md' must be professional. The 'LICENSE' must contain the full text of the MIT license.�OBJECT�STRINGzNThe complete, single-file HTML content with inline CSS and JS, using Tailwind.)�typerz9The professional Markdown content for the project README.z!The full text of the MIT license.)z69index.htmlz	README.md�LICENSE)r��70properties�requiredr?�partszapplication/json)�responseMimeType�responseSchema)�contents�systemInstruction�generationConfigrVr"z?key=�<r NzContent-Typer&�71candidatesrr�z7--- [LLM_CALL] Successfully generated files on attempt �. ---z%--- [LLM_CALL] HTTP Error on attempt r,z+--- [LLM_CALL] Processing Error on attempt r*z$--- [LLM_CALL] Retrying LLM call in � seconds... ---zB--- [LLM_CALL] Failed to generate code after multiple retries. ---zLLM Code Generation Failure)r3�lower�strip�appendrd�GEMINI_API_URL�GEMINI_API_KEYr1r2r4r6r'�loadsr<�RequestError�KeyError�JSONDecodeErrorrbrcr@)r�rIr��normalized_prompt�
system_prompt�response_schemar��	all_partsrE�max_retries�72base_delay�attempt�urlrDr=�result�	json_text�generated_filesrGrps                    r
�call_llm_for_coder��s����73�A�'��J_�74`�a�����,�,�.���,�,��EV�1V�
�Z�[��
k�	75��	U���#+�=M�N�"*�;v�w� (�9\�]�76�77;��O��H����f��#78�79�	�	���'�9�.�/�	���'�f�f�$6�#7�9�:��&�6�=�)B�(C�E� 2�-�80��G��K��J���%��	Y�#�$�E�.�)9�:�C��(�(��4�4��!'���� �+�-?�@�"-�"���81�)�)�+�"�����#�<�0��3�I�>�w�G��J�6�R�	�#'�*�*�Y�"7���O�PW�Z[�P[�}�\a�b�c�&�%5�4�4�	&�H82�83N�O�84�1�852�2�C5��5�4�4�4��(�$�$�	S��9�'�A�+��b���5�Q�R�R���"�"�H�d�.B�.B�C�	Y��?��!��}�B�q�c�QV�W�X�X��	Y���1�_�$��!�w�,�/�E��8����O�P��-�-��&�&�&�s��B<I/�?'F/�&F�'F/�*F�F�A!F�#F/�/F�0F/�4I/�F/�F�F/�F,	�F�F,	�(F/�+I/�,F/�/H(�G�I/�,H(�	H#�I/�#H(�(	I/�60I/�&I)�'I/�evaluation_url�email�noncerXrYrZc	���# �UUUUUUUS.nSn	Sn86[SUS35 [U	5Hrn[R"SS9IShv�NnUR	XS	9IShv�Nn
U
R5 [S87U
RS35 SSS5IShv�N  g [SU	S35 gNiNTN!,IShv�N(df   Oj=f![Ran[SUS-S
US35 SnAO9SnAf[Ran[SUS-S
US35 SnAOSnAff=fX�S-88:dGMU89SU--n[SUS35 [R"U5IShv�N GMQ7f)zP90Calls the evaluation_url to notify the server that the code has been deployed.91)r��task�roundr�rXrYrZrVr"z2--- [NOTIFICATION] Attempting to notify server at r-rQr N)r'z;--- [NOTIFICATION] Successfully notified server. Response: Tz)--- [NOTIFICATION] HTTP Error on attempt r,r�z,--- [NOTIFICATION] Request Error on attempt r*z--- [NOTIFICATION] Retrying in r�z<--- [NOTIFICATION] Failed to notify evaluation server after z attempts. ---F)r3rdr1r2r4r6r>r<r�rbrc)r�r�rIrr�rXrYrZrEr�r�r�rDr=rGrps                r
�notify_evaluation_serverr�ms��������� ���G��K��J�	�>�~�>N�d�92S�T���%��93	Z��(�(��4�4��!'���^��!J�J���)�)�+��S�T\�Th�Th�Si�im�n�o��5�4�4�&�$94�H��
�Uc�95d�e��#5�J�5�4�4�4���$�$�	W��=�g��k�]�"�Q�C�u�U�V�V���!�!�	Z��@��1��
�R�PQ�s�RW�X�Y�Y��	Z���1�_�$��!�w�,�/�E��3�E�7�/�J�K��-�-��&�&�&�s��,E<�C�B1�C�B7�B3�.B7�
C�B5�C�E<�1C�3B7�5C�7C	�=C�>C	�96C�
E<�C�D5�%C?�:E<�?D5�D0�+E<�0D5�5	E<�0E<�3E6�4E<r��attachmentsc	��(# �/n[S[U5SUS35 UGH&nURnURnU(aU(aUR	S5(d[SU35 MP[97R"SU[98R5nU(d[SU35 M�URS5n[RRX5n[R"U5n	[US	5n99U100RU	5 S101S102S1035 [SUS[U	5S
35 UR!U5 GM) U$!,(df   NA=f!["a%n[SUSU35 [#SUS35eS104nAff=f7f)zz105Decodes and saves attachments (provided as Base64 Data URIs) into the task directory.106Returns a list of saved filenames.107z--- [ATTACHMENTS] Processing z attachments for: r-rtz3    -> WARNING: Skipping invalid attachment entry: zbase64,(.*)z4    -> ERROR: Could not find base64 data in URI for r"�wbNz    -> Saved Attachment: r�r�z(    -> CRITICAL ERROR saving attachment r,zFailed to save attachment r�)r3r�r#r�rzr{r|r}r~r�rTr��base64�	b64decoder�r�r�r@)r�r��saved_files�108attachmentr�rrrrvr��109file_bytesr�rGs            r
�save_attachments_locallyr��so���110�K�	�)�#�k�*:�);�;M�h�Z�W[�111\�]�!�112��?�?���>�>���x�x�/B�/B�7�/K�/K��G��z�R�S���	�	�.�(�B�M�M�B����H��113�S�T���k�k�!�n���G�G�L�L��4�	�
	N��)�)�+�6�J��i��&�!����114�#�'�
�-�h�Z�x��J��?P�PW�X�Y����x�(�5"�@��'�&���	N��<�X�J�b���L�M��8��115�)�L�M�M��	N�sB�CF� "E �E�4E �F�116E	�E � 117F�* F118�119F�F�	task_datac���# �URnURnURnURnURnUR120nURn[SUSUS35 URSS5R5n[Rn	[Rn121SU	SU122SU	S	US1233	nSU	S	U3n[RR[R "5S5n
[RRX�5n[RR#U5(a2[S
US35 Sn[$R&"X�S9 [S5 [R*"USS9 [SUS35 [-UUUUUS9IShv�Nn/n/nUHen[/UR05(a-[3UR05nU(aUR5U5 UR5UR65 Mg [S[9U5S35 SRU5nUS:�a124SUSUS3nOS US!3nU(aUS"US#3-
nUS$-
n[;UUU5IShv�Nn[=UU5IShv�N [?X�5IShv�N [S%USUS&35 [AUUUUS'9IShv�NnUS(nUS)nUS*n[S+US,US35 [CUUUUUUUUS-9IShv�N [S0US135 g![(a!n[SU35 [)SU35eSnAff=fGN�N�N�N�N�NM![(an[S.US/US35 SnANlSnAff=f7f)2z�125The asynchronous background process that executes the main project workflow.126It adapts the LLM prompt for multi-round tasks and fixes the cloning order.127z2128--- [PROCESS START] Starting background task for z, Round r-� �-r�:z@github.com/rLz.gitrKr�z1--- [CLEANUP] Deleting existing local directory: c��US[LdS[US5;a.[R"U[R1295 U"U5 ge)z<Error handler for shutil.rmtree to handle permission issues.rz130WinError 5r"N)�PermissionError�strr��chmod�stat�S_IWUSR)�funcrT�exc_infos   r
�onerror�*generate_files_and_deploy.<locals>.onerror�s;���A�;�/�1�\�S��RS��EU�5U��H�H�T�4�<�<�0���J�r)r�z1--- [CLEANUP] Directory deleted successfully. ---z3!!! CRITICAL: Failed to clean up directory. Error: z!Failed to perform local cleanup: NTr�z;--- [DEPLOYMENT] Setting up local Git repository for Round z... ---)rrrrrz--- [LLM_INPUT] Found z image(s) to pass to LLM. ---z, r"zUPDATE INSTRUCTION (ROUND zi): You must modify the existing project files (index.html, README.md, LICENSE) based on this new brief: 'z�'. You must replace all content in 'index.html', 'README.md', and 'LICENSE' with new, complete versions that implement the requested modifications. The 'index.html' must remain a single, complete, fully responsive HTML file using Tailwind CSS.zPGenerate a complete, single-file HTML web application to achieve the following: z�. Ensure your code is fully responsive, and uses Tailwind CSS. Provide the code for the main web app, a README.md, and an MIT LICENSE.zL131Additional context: The following files are available in the project root: z. zBEnsure your code references these files correctly (if applicable).z0--- [DEPLOYMENT] Committing and Publishing task z to GitHub... ---)rFrIrrrXrYrZz --- [DEPLOYMENT] Success! Repo: z	, Pages: )r�r�rIrr�rXrYrZz--- [CRITICAL FAILURE] Task z failed during processing: z&--- [PROCESS END] Background task for z completed. ---)"r�r�r��briefr�r�r�r3�replacer�rr/r0r�rTr�r��exists�shutil�rmtreer@r�rHr�r�r�r�r#r�r�r�r�rqr�)r�rIr�rr�r�r�r�rrBrCrrr�rr�rGrFr��attachment_list_for_llm_promptr��gemini_part�attachment_list_str�132llm_promptr��deployment_inforXrYrZs                             r
�generate_files_and_deployr��s���133�n�n�G��O�O�E��/�/�K��O�O�E��-�-�N��O�O�E��'�'�K�134�?��y��Q\�P]�]a�135b�c�����S�)�/�/�1�I��.�.�O��(�(�L���/�q���l�?�J[�[\�]f�\g�gk�l�M�)�/�):�!�I�;�G�M�}Z��7�7�<�<��	�	��->�?���W�W�\�\�(�4�136��7�7�>�>�*�%�%��E�j�\�QU�V�W�
�
I��
�
�j�:��I�J�	���J��.�137	�K�K�=�X_�`�a�%�!��'�'�#�138�139����)+�&�%�J� ����0�0�5�j�n�n�E����&�&�{�3�
+�1�1�*�/�/�B�&�	�&�s�;�'7�&8�8U�V�W�"�i�i�(F�G��140��?�-�[�M�:N�NS�W�UA�A�
�c�ch�bi�jZ�Z�
��
�j�k~�j�@B�C�C�Z�
�_�
`�Z�!2�*�g�{� S�S��+�7�O�D�D�D�141'�z�?�?�?�	�@��	��R]�Q^�^o�p�q� 2���#��	!142�143��#�:�.��$�\�2�144�#�K�0�	�
�0��145�)�I�;�d�S�T�'�)���#���!��	146�		147�		148�149�2�7�)�?�150K�L��U�
I��K�A�3�O�P��"C�A�3� G�H�H��
I��151�jT�	E�152	@�153154�		155���Z�
�,�W�I�5P�QR�PS�SW�X�Y�Y��Z�s��B>M4�BM�156L�)4M�L>�CM�5M�6M�	M�157M�M�%M�M�8M�;M	�<M�M4�158L;�L6�6L;�;M�M�M�M�M�	M�159M1�M,�'M4�,M1�1M4z/readyrW)r>c��l# �[UR5(d#[SURS35 [	SSS9eUR5q[S5 [S[SS	[S16035 [R"[U55 [SSS
URS3S.S9$7f)z�161API endpoint that receives the task payload. 162It verifies the secret and starts the generation/deployment process in the background.163z(--- FAILED SECRET VERIFICATION for task r-i�z>Unauthorized: Secret does not match configured student secret.)r>�detailz"--- TASK RECEIVED SUCCESSFULLY ---z	Task ID: r�z	, Round: r�rW�readyrNz! received and processing started.)�status�message)r>r�)r�secretr3r�r�dict�received_task_datarb�create_taskr�r)r�s r
�receive_taskr�fs������)�)�*�*�
�8����8H��M�N���S�164�	165�#���)��	�166.�/�	�I�(��0�1��;M�g�;V�:W�167X�Y����1�)�<�=���"��y�~�~�6F�Fg�/h�i���s�B2B4rLc��# �SS0$7f)Nr�zBTask Receiver Service is running. Post to /ready to submit a task.�r�rr
�rootr��s����[�\�\�s�z/statusc��8# �[(aS[0$SS0$7f)N�last_received_taskr�z(Awaiting first task submission to /ready)r�r�rr
�168get_statusr��s%�����$�&8�9�9��E�F�F�s�)0�fastapirr�starlette.responsesr�modelsr�configrrbr1r'r�r�r{r7�timer�r�rr��boolrr5r/rgr�r��appr��intr8rHr�rqr�r�r��listr�r�r�r�r4r�rer�r�r�rr
�<module>rsk��*�,������	�
�	�169��
���>��:�s�:�t�:�170+���x�7�7�8�171�C��z���(�(��
�172/�g�����(M�s�(M�s�(M�3�(M�_b�(M�qt�(M�y|�zB�zB�(M�VU�3�8�8�U�c�U��U�X[�U�`d�U�v �c� �d� �DW��W��W����D��S��@k3�C�k3�#�k3�D�k3�T�k3�\/��/��/��/��	/�173�/��
/��/��/�174�/�d(�S�(�t�(��(�XVM�{�VM�v���(���$��+��%��<�����]��]������G��Gr