
    #jaI              :      >   d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	m
Z
 d dlmZ d dlmZmZmZ d dlZd dlZd dlmZ d dlmZmZmZmZmZmZmZmZmZmZm Z  d dl!m"Z" d d	l#m$Z$m%Z%  ejL                   e' ejP                                     Z) ejL                   e' ejP                                     Z* ejL                  e      Z+dd
Z,dZ- ej\                  d      Z/ddZ0 ejb                  ddi       ejd                  dd       ejf                  de4ddd       ejf                  de5ddd       ejf                  de4dd       ejf                  de5dd        ejf                  d!dd"d#$       ejf                  d%d&dd' ejl                  d(      )       ejf                  d*d+dd,-       ejf                  d.d/dd0-       ejf                  d1e7d2dd34       ejf                  d5de5d67       ejf                  d8e4 e,e      d9d:d;       ejf                  d<e4 e,e      d9d=d;       ejf                  d>e4 e,e       d9d?d;       ejf                  d@e5dAdBd       ejf                  dCe5dDdEd       ejf                  dFe7dGdHd       ejf                  dIe7dGdJd       ejf                  dKe8ddLd       ejf                  dMe*d9dNd       ejf                  dOe+d9dPd       ejf                  dQ ejl                  d(      ddRd       ejf                  dS ejl                  d(      ddTd       ejf                  dUe)ddVd       ejf                  dWdddX$       ejf                  dYdddZ$       ejf                  d[ddd\$       ejf                  d]ddd^$       ejf                  d_ddd`$       ejf                  dae4ddb       ejf                  dce4ddde       ejf                  dfe5ddg       ejf                  dhe5didj       ejf                  dke5ddl       ejf                  dme5d dnd       ejf                  doe5dpdqd       ejf                  dre5dds       ejf                  dte5dpdud       ejf                  dve4ddwd       ejf                  dxe4ddyd       ejf                  dze4dd{d       ejf                  d|e5 e5e      d}d       ejf                  d~e5 e5ejr                        dd       ejf                  de4ddd       ejf                  de4ddd       ejf                  dddd-       ejf                  dde0d"dd       ejf                  ddddd       ejf                  dde5dd       ejf                  ddd"dd       ejf                  ddd"dd      	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                                                                                                                                                                                                                                                                                                                                                                            Z:ddddd9d9d9dAdDdGdGdd9d9d"dddd2ddeddddddddddidd dpddpdddeejr                  ddddddd"dd"d2	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ;ddZ<e=dk(  r e:        yy)    )annotationsN)Callable)RawConfigParser)IOAnyget_args)ASGIApplication)
INTERFACESLIFESPAN
LOG_LEVELSLOGGING_CONFIGSSL_PROTOCOL_VERSIONConfigHTTPProtocolTypeInterfaceTypeLifespanTypeLoopFactoryTypeWSProtocolType)Server)ChangeReloadMultiprocessc                L    ddj                  d t        |       D               dS )N[|c              3  ,   K   | ]  }|d k7  s	|  yw)noneN ).0keys     b/home/mi/.openclaw/workspace/fridge-app/backend/.venv/lib/python3.12/site-packages/uvicorn/main.py	<genexpr>z%_metavar_from_type.<locals>.<genexpr>(   s     H#-Hs   
])joinr   )_types    r    _metavar_from_typer%   '   s%    sxxHxHHIKK       uvicorn.errorc           	        |r| j                   ry t        j                  dj                  t        j
                  t        j                         t        j                         t        j                                      | j                          y )NzKRunning uvicorn {version} with {py_implementation} {py_version} on {system})versionpy_implementation
py_versionsystem)resilient_parsingclickechoformatuvicorn__version__platformpython_implementationpython_versionr-   exit)ctxparamvalues      r    print_versionr;   0   sf    C))	JJU\\''&<<>..0??$	 	] 	
 HHJr&   auto_envvar_prefixUVICORN)context_settingsappUVICORN_APP)envvarz--hostz	127.0.0.1zBind socket to this host.T)typedefaulthelpshow_defaultz--porti@  zABind socket to this port. If 0, an available port will be picked.z--udszBind to a UNIX domain socket.)rB   rC   rD   z--fdz)Bind to socket from this file descriptor.z--reloadFzEnable auto-reload.)is_flagrC   rD   z--reload-dirreload_dirszRSet reload directories explicitly, instead of using the current working directory.)exists)multiplerD   rB   z--reload-includereload_includeszSet glob patterns to include while watching for files. Includes '*.py' by default; these defaults can be overridden with `--reload-exclude`. This option has no effect unless watchfiles is installed.)rI   rD   z--reload-excludereload_excludeszSet glob patterns to exclude while watching for files. Includes '.*, .py[cod], .sw.*, ~*' by default; these defaults can be overridden with `--reload-include`. This option has no effect unless watchfiles is installed.z--reload-delayg      ?zTDelay between previous and next check if application needs to be. Defaults to 0.25s.)rB   rC   rE   rD   z	--workersz~Number of worker processes. Defaults to the $WEB_CONCURRENCY environment variable if available, or 1. Not valid with --reload.)rC   rB   rD   z--loopautoz"Event loop factory implementation.)rB   metavarrC   rD   rE   z--httpzHTTP protocol implementation.z--wsz"WebSocket protocol implementation.z--ws-max-sizei   z#WebSocket max size message in bytesz--ws-max-queue    z2The maximum length of the WebSocket message queue.z--ws-ping-intervalg      4@z#WebSocket ping interval in seconds.z--ws-ping-timeoutz"WebSocket ping timeout in seconds.z--ws-per-message-deflatez)WebSocket per-message-deflate compressionz
--lifespanzLifespan implementation.z--interfacez:Select ASGI3, ASGI2, or WSGI as the application interface.z
--env-filezEnvironment configuration file.z--log-configzBLogging configuration file. Supported formats: .ini, .json, .yaml.z--log-levelzLog level. [default: info]z--access-log/--no-access-logzEnable/Disable access log.z--use-colors/--no-use-colorsz!Enable/Disable colorized logging.z"--proxy-headers/--no-proxy-headerszaEnable/Disable X-Forwarded-Proto, X-Forwarded-For to populate url scheme and remote address info.z"--server-header/--no-server-headerz%Enable/Disable default Server header.z--date-header/--no-date-headerz#Enable/Disable default Date header.z--forwarded-allow-ipszComma separated list of IP Addresses, IP Networks, or literals (e.g. UNIX Socket path) to trust with proxy headers. Defaults to the $FORWARDED_ALLOW_IPS environment variable if available, or '127.0.0.1'. The literal '*' means trust everything.z--root-path zLSet the ASGI 'root_path' for applications submounted below a given URL path.z--limit-concurrencyz^Maximum number of concurrent connections or tasks to allow, before issuing HTTP 503 responses.z	--backlogi   z0Maximum number of connections to hold in backlogz--limit-max-requestszEMaximum number of requests to service before terminating the process.z--limit-max-requests-jitterzuMaximum jitter to add to limit_max_requests. Staggers worker restarts to avoid all workers restarting simultaneously.z--timeout-keep-alive   zYClose Keep-Alive connections if no new data is received within this timeout (in seconds).z--timeout-graceful-shutdownz8Maximum number of seconds to wait for graceful shutdown.z--timeout-worker-healthcheckzKMaximum number of seconds to wait for a worker to respond to a healthcheck.z--ssl-keyfilezSSL key filez--ssl-certfilezSSL certificate filez--ssl-keyfile-passwordzSSL keyfile passwordz--ssl-versionz,SSL version to use (see stdlib ssl module's)z--ssl-cert-reqsz@Whether client certificate is required (see stdlib ssl module's)z--ssl-ca-certszCA certificates filez--ssl-cipherszNCiphers to use (see stdlib ssl module's). Defaults to OpenSSL's safe defaults.z--headerheaderszASpecify custom default HTTP response headers as a Name:Value pairz	--versionz%Display the uvicorn version and exit.)rF   callbackexpose_valueis_eagerrD   z	--app-dirzuLook for APP in the specified directory, by adding this to the PYTHONPATH. Defaults to the current working directory.)rC   rE   rD   z--h11-max-incomplete-event-sizeh11_max_incomplete_event_sizezFFor h11, the maximum number of bytes to buffer of an incomplete event.z--reset-contextvarszXRun each ASGI request in a fresh contextvars.Context. Hides context set in the lifespan.)rF   rC   rD   rE   z	--factoryzFTreat APP as an application factory, i.e. a () -> <ASGI app> callable.c2                   t        | fi d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|t        n|d|d|d|d|d|xs d d|xs d d|xs d d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$d%|%d&|&d'|'d(|(d)|)d*|*d+|+d,|,D 2cg c]  }2|2j                  d-d.       c}2d/|-d0|1d1|.d2|/d3|0 y c c}2w )4Nhostportudsfdloophttpwsws_max_sizews_max_queuews_ping_intervalws_ping_timeoutws_per_message_deflatelifespanenv_file
log_config	log_level
access_log	interfacereloadrG   rJ   rK   reload_delayworkersproxy_headersserver_headerdate_headerforwarded_allow_ips	root_pathlimit_concurrencybackloglimit_max_requestslimit_max_requests_jittertimeout_keep_alivetimeout_graceful_shutdowntimeout_worker_healthcheckssl_keyfilessl_certfilessl_keyfile_passwordssl_versionssl_cert_reqsssl_ca_certsssl_ciphersrQ   :   
use_colorsfactoryapp_dirrU   reset_contextvars)runr   split)3r?   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rh   ri   rG   rJ   rK   rj   rk   rd   re   rf   rg   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   rQ   r   r   rU   r   r   headers3                                                      r    mainr   >   sU   v 33 3 	3
 3 3 3 3  3 "3 *3 (3  63 3 3  &0%7>Z!3" #3$ %3& '3( )3*  '4+3, (/4-3. (/4/30 "132 334 $536 $738  93: 0;3< =3> ,?3@ A3B .C3D #<E3F .G3H #<I3J $>K3L  M3N "O3P 2Q3R  S3T $U3V "W3X  Y3Z 5<<&c1%<[3\ ]3^ _3` a3b 'Dc3d ,e3Z =s   #C)2rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rh   ri   rG   rJ   rK   rj   rk   rd   re   rf   rg   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   ssl_context_factoryrQ   r   r   r   rU   r   c       2           |/ t         j                  j                  d|/       t        | fi d|d|d|d|d|d|d|d	|d
|	d|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d |d!| d"|!d#|"d$|#d%|$d&|%d'|&d(|'d)|(d*|)d+|*d,|+d-|,d.|-d/|.d0|0d1|1d2|2}3|3j                  s|3j
                  d3kD  rKt        | t              s;t        j                  d4      }4|4j                  d5       t        j                  d3       |3j                          t        |36      }5	 |3j                  r8|3j                         }6t!        |3|5j"                  |6g7      j#                          nW|3j
                  d3kD  r8|3j                         }6t%        |3|5j"                  |6g7      j#                          n|5j#                          |3j(                  rIt*        j                  j-                  |3j(                        r t+        j.                  |3j(                         	 |5j0                  s7|3j                  s*|3j
                  d3k(  rt        j                  t2               y y y y # t&        $ r Y w xY w# |3j(                  rJt*        j                  j-                  |3j(                        r t+        j.                  |3j(                         w w w xY w)8Nr   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rh   ri   rG   rJ   rK   rj   rk   rd   re   rf   rg   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   rQ   r   r   rU   r   r   r(   zRYou must pass the application as an import string to enable 'reload' or 'workers'.)config)targetsockets)syspathinsertr   ri   rk   
isinstancestrlogging	getLoggerwarningr7   load_appr   should_reloadbind_socketr   r   r   KeyboardInterruptrY   osrH   removestartedSTARTUP_FAILURE)7r?   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rh   ri   rG   rJ   rK   rj   rk   rd   re   rf   rg   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   r   rQ   r   r   r   rU   r   r   loggerserversocks7                                                          r    r   r     s   l 7#33 3 	3
 3 3 3 3  3 "3 *3 (3  63 3 3  !3"  #3$ (%3& ('3( ")3* +3, -3. /30 132 334 $536 $738  93: 0;3< =3> ,?3@ A3B .C3D #<E3F .G3H #<I3J $>K3L  M3N "O3P 2Q3R  S3T $U3V "W3X  Y3Z 0[3\ ]3^ _3` a3b 'Dc3d ,e3Fh 	!+ZS5I""?3kl
OO6"F"%%'D

TFCGGI^^a%%'D

TFCGGIJJL ::"''..4IIfjj!>>&"6"66>>Q;N! <O"6>   ::"''..4IIfjj! 5:s&   BI7 7	J J JJ AKc                z    | dk(  r"t        j                  dt               ddlm} |S t        dt         d|        )NServerStatezOuvicorn.main.ServerState is deprecated, use uvicorn.server.ServerState instead.r   )r   zmodule z has no attribute )warningswarnDeprecationWarninguvicorn.serverr   AttributeError__name__)namer   s     r    __getattr__r   w  s@    }]	
 	/
78*,>tfE
FFr&   __main__)r$   r   returnr   )r8   zclick.Contextr9   zclick.Parameterr:   boolr   None)fr?   r   rW   r   rX   intrY   r   rZ   r   r[   LoopFactoryType | strr\   zHTTPProtocolType | strr]   zWSProtocolType | strr^   r   r_   r   r`   floatra   r   rb   r   rc   r   rh   r   ri   r   rG   	list[str]rJ   r   rK   r   rj   r   rk   r   rd   r   re   r   rf   r   rg   r   rl   r   rm   r   rn   r   ro   r   rp   r   rq   r   rr   r   rs   r   rt   r   ru   r   rv   
int | Nonerw   r   rx   r   ry   r   rz   r   r{   r   r|   r   r}   r   r~   
str | NonerQ   r   r   r   r   r   rU   r   r   r   r   r   r   r   )hr?   z*ASGIApplication | Callable[..., Any] | strrW   r   rX   r   rY   r   rZ   r   r[   r   r\   z/type[asyncio.Protocol] | HTTPProtocolType | strr]   z-type[asyncio.Protocol] | WSProtocolType | strr^   r   r_   r   r`   float | Nonera   r   rb   r   rc   r   rh   r   ri   r   rG   list[str] | str | NonerJ   r   rK   r   rj   r   rk   r   rd   str | os.PathLike[str] | Nonere   zJdict[str, Any] | str | os.PathLike[str] | RawConfigParser | IO[Any] | Nonerf   zstr | int | Nonerg   r   rl   r   rm   r   rn   r   ro   r   rp   r   rq   r   rr   r   rs   r   rt   r   ru   r   rv   r   rw   r   rx   r   ry   r   rz   r   r{   r   r|   r   r}   r   r~   r   r   zGCallable[[Config, Callable[[], ssl.SSLContext]], ssl.SSLContext] | NonerQ   zlist[tuple[str, str]] | Noner   zbool | Noner   r   r   r   rU   r   r   r   r   r   )r   r   r   r   )>
__future__r   asyncior   r   r4   sslr   r   collections.abcr   configparserr   typingr   r   r   r/   r2   uvicorn._typesr	   uvicorn.configr
   r   r   r   r   r   r   r   r   r   r   r   r   uvicorn.supervisorsr   r   ChoicelistkeysLEVEL_CHOICESLIFESPAN_CHOICESINTERFACE_CHOICESr%   r   r   r   r;   commandargumentoptionr   r   Pathr   r   	CERT_NONEr   r   r   r   r   r&   r    <module>r      s   "   	  
 
  $ ( $ $   *    " :T/*//"3455<<]X]]_ 56  ELL, L 			?	+ !5y ABm,		$ 		L gC4STf33^_j$<QR	]	4	  
@	 
	 		_ 	
=	 	/	- 	/0	( 
	~.	- 		. 		= 		. 		- 		4 		# 		E 	4	 	* 	4	 	M 		% "	%	 "	,	 (	l	 (	0	 $	.	 	
.	 		W	 		i	 		;	 		P	 !	
P 		d !		C	 "		V oCNY]^		 		 	$%	7 		K 		 		Y 	L	 	0 
2	 %#		Q 	c 	Qg	g
g g 
	g
 	g  g !g 	g g g g g !g g g  !g" #g$ %g& 'g( )g* +g, -g. /g0 1g2 3g4 5g6 7g8 9g: ;g< =g> ?g@ AgB CgD  #EgF GgH  *IgJ !$KgL MgN OgP QgR SgT UgV WgX YgZ [g\ ]g^ _g` $.agb cgd egf 
gg _ S ` U - CN
gZ "(<B8>%)$(#'#%*..2.2.2]k"&26$(%)%&,0&'1526'++26"cg,0"04#iE"	3E" E" 	E"
 
E" 	E"  E" :E" 	6E" E" E" #E" "E" !E" E"  !E"" #E"$ (%E"& ,'E"( ,)E"* +E", -E". ,/E"0 [1E"2  3E"4 5E"6 7E"8 9E": ;E"< 0=E"> ?E"@ "AE"B CE"D #EE"F  #GE"H IE"J  *KE"L !$ME"N /OE"P 0QE"R %SE"T UE"V WE"X 0YE"Z [E"\ a]E"^ *_E"` aE"b cE"d eE"f $.gE"h iE"j 
kE"P	G zF r&   