rlx-web 0.2.13

WebAssembly entry point for RLX — run models in the browser (CPU backend; WebGPU device bring-up)
Documentation
+
J@j���N�Rt^RIHt^RIt^RIt^RIt^RIt^RIt^RIt^RI	H
t
RtRtRt
Rt]
!]4P!4P"t]P"P"t]R,t]R	,tR
RltRR
ltRRltRRltRRlt]R8Xd
]!4R#R#)a�Build the rlx-web WebAssembly bundle and (optionally) serve the demo.

One command, all platforms (macOS / Linux / Windows):

    python3 crates/rlx-web/build.py            # CPU build -> web/pkg
    python3 crates/rlx-web/build.py --webgpu   # also bring up a WebGPU device
    python3 crates/rlx-web/build.py --serve     # build + serve the demo

The `wasm-bindgen` CLI must match the `wasm-bindgen` crate version. If it is
missing or mismatched, this script prints the exact `cargo install` command.
)�annotationsN)�Pathzrlx-webzrlx_web.wasm�rlx_webzwasm32-unknown-unknown�web�pkgc� �V^8�dQhRRRR/#)��cmdz	list[str]�returnzsubprocess.CompletedProcess�)�formats"�crates/rlx-web/build.py�__annotate__r&s��1�1�Y�1�!<�1�c�j�\RRPV44\P!V3RR/VB#)�·� �checkT)�print�join�
subprocess�run)r	�kws&,r
rr&s-��	�$�����
���>�>�#�0�T�0�R�0�0rc��V^8�dQhRR/#)rr
�strr)rs"r
rr+s��
A�
A�C�
Arc���\P!.RO\RRRR7p\P!VP
4pVR,FpVR,R8XgKVR,u#	\
R4h)	z;Read the locked wasm-bindgen version from `cargo metadata`.T��cwdr�capture_output�text�packages�name�wasm-bindgen�versionz(wasm-bindgen not found in cargo metadata)�cargo�metadata�--format-version�1)rr�	WORKSPACE�json�loads�stdout�
SystemExit)�out�metars   r
�wasm_bindgen_crate_versionr/+sf��
�.�.�6��T�$�T��C��:�:�c�j�j�!�D��J�����v�;�.�(��y�>�!� ��?�
@�@rc� �V^8�dQhRRRR/#)r�expectedrr
r)rs"r
rr8s����#��#�rc�*�\P!R4pRV2pVf\RV24h\P!VR.RRRR7pVP
P
4P4R	,pW@8wd\RVRVRV24hV#)
r"z)cargo install wasm-bindgen-cli --version z@wasm-bindgen CLI not found.
  Install the matching version:
    z	--versionT)rrrzwasm-bindgen CLI z
 != crate z (they must match).
  Fix:
    �����)�shutil�whichr,rrr+�strip�split)r1�exe�install�got�vers&    r
�ensure_wasm_bindgenr<8s���
�,�,�~�
&�C�9�(��D�G�
�{��P�QX�PY�Z�
�	
��.�.�#�{�+�4��SW�
X�C�

�*�*�
�
�
�
"�
"�
$�R�
(�C�
�����u�J�x�j�9�"�)�
%�
�	
��Jrc��V^8�dQhRR/#)rr
rr)rs"r
rrIs��<�<�D�<rc��\P!.RO\RRRR7p\\P
!VP4R,4#)r$Tr�target_directory)r$r%r&r'z	--no-deps)rrr(rr)r*r+)r-s r
�
target_dirr@Is<��
�.�.�C��T�$�T��C���
�
�3�:�:�&�'9�:�;�;rc��V^8�dQhRR/#)rr
�Noner)rs"r
rrQs��0$�0$�d�0$rc���\P!RR7pVPRRRR7VPRRRR7VPRRR	R7VPR
\RRR
7VP	4p\4p\
V4p\RRR\.4RRR\R\.pVP'gVPR4VP'dVRR.,
p\V\R7VP'dRMRp\4\,V,\,pVP!4'g\#RV24h\$P'RRR7\VRRR\)\$4R \*\)V4.4\-R!\$24\-R"VP'dR#MR$24VP.'d�^R%Ip^R%Ip^R%Ip	VP7VP8P:\)\<4R&7p
R'VP>R(2p\-R)\<R*VR+24\@PB!V4V	PGR,VP>3V
4;_uu_4pVPI4R%R%R%4R%#R%# \DdLQi;i \Jd\-R-4L5i;i +'giR%#;i).zBuild the rlx-web wasm bundle.)�descriptionz--webgpu�
store_truezenable the WebGPU device path)�action�helpz--servezserve the demo after buildingz--debugzdebug build (default: release)z--porti@zport for --serve)�type�defaultrG�rustup�target�addr$�buildz-pz--targetz	--releasez
--features�webgpu)r�debug�releasez"expected wasm artifact not found: T)�parents�exist_okrz	--out-dirz
--out-nameu
✓ bundle ready: z  backend: zWebGPU device + CPU�CPUN)�	directoryzhttp://localhost:�/z	
Serving z at z  (Ctrl-C to stop)�z	
stopped.)&�argparse�ArgumentParser�add_argument�int�
parse_argsr/r<r�TARGET�CRATErO�appendrNr(r@�
WASM_ARTIFACT�existsr,�PKG_DIR�mkdirr�OUT_NAMEr�serve�	functools�http.server�socketserver�partial�server�SimpleHTTPRequestHandler�WEB_DIR�port�
webbrowser�open�	Exception�	TCPServer�
serve_forever�KeyboardInterrupt)
�ap�argsr1�bindgenr$�profile�wasmre�httprg�handler�url�httpds
             r
�mainr|Qsf��	�	 �	 �-M�	N�B��O�O�J�|�:Y�O�Z��O�O�I�l�9X�O�Y��O�O�I�l�9Y�O�Z��O�O�H�3��;M�O�N�
�=�=�?�D�)�+�H�!�(�+�G���8�U�F�+�,�
�g�t�U�J��?�E��:�:�:�
���[�!��{�{�{�
�,��)�)����9������g��G��<�&� �7�*�]�:�D��;�;�=�=��=�d�V�D�E�E��M�M�$��M�.���*�e�[�#�g�,�	�x��T��	,�-�
� ��	�
*�+�	�K�����-�%�H�
I�J��z�z�z�����#�#�D�K�K�$H�$H�TW�X_�T`�#�a��!�$�)�)��A�.��
�
�7�)�4��u�,>�?�@�	��O�O�C� ��
#�
#�R����O�W�
=�
=��
$��#�#�%�>�
=����	��	��
%�
$��l�#�
$��>�
=�
=�s<�J2�K�K�2K�?K�K�K�K�K�K0	�__main__)�__doc__�
__future__rrWr)r4r�sysrm�pathlibrr]r_rcr\�__file__�resolve�parent�HEREr(rkrarr/r<r@r|�__name__rrr
�<module>r�s���

�#���
��
������
���	!���H�~����&�&���K�K���	�
��,��
�E�/��1�

A��"<�0$�f�z���F�r